CWB
Data Structures | Defines | Functions | Variables

concordance.c File Reference

#include <stdio.h>
#include "../cl/globals.h"
#include "../cl/macros.h"
#include "../cl/corpus.h"
#include "../cl/attributes.h"
#include "../cl/cdaccess.h"
#include "concordance.h"
#include "attlist.h"
#include "options.h"

Data Structures

Defines

Functions

Variables


Define Documentation

#define MAX_S_ATTRS   1024
#define MAXKWICLINELEN   65535

Referenced by compose_kwic_line().

#define SRESIZE   1024

Referenced by add_to_string().


Function Documentation

void add_to_string ( char **  s,
int *  spos,
int *  ssize,
char *  suffix 
)

References cl_malloc(), cl_realloc(), and SRESIZE.

int append ( char *  s,
char *  suffix,
int *  sp,
int  max_sp 
)

Appends one string to another whicle keeping track of the overall length.

Parameters:
sThe string to modify.
suffixThe string you want to append to s.
spIndex into s indicating the end of its current content. For example, if the string contains "blob", sp would be 4. sp is modified by this function to point to the end of the content after appending has been complete.
max_spSize of the s array (ie, no character after s[max_sp-1] will be written to).
Returns:
The number of characters copied.

Referenced by compose_kwic_line(), get_field_separators(), get_position_values(), and get_print_attribute_values().

char* compose_kwic_line ( Corpus corpus,
int  match_start,
int  match_end,
ContextDescriptor cd,
int *  length,
int *  s_mb,
int *  s_me,
char *  left_marker,
char *  right_marker,
int *  position_list,
int  nr_positions,
int *  returned_positions,
ConcLineField fields,
int  nr_fields,
ConcLineLayout  orientation,
PrintDescriptionRecord pdr,
int  nr_mappings,
Mapping mappings 
)
void FreeConcordanceLine ( ConcordanceLine line_p)
char* get_field_separators ( int  position,
ConcLineField fields,
int  nr_fields,
int  at_end,
PrintDescriptionRecord pdr 
)
Returns:
A pointer to a function-internal static string containing the requested string. Do not free it.

References append(), CL_MAX_LINE_LENGTH, _print_descr_rec_::printField, and _ConcLineField::type.

Referenced by compose_kwic_line().

int get_position_values ( ContextDescriptor cd,
int  position,
char *  s,
int *  sp,
int  max_sp,
int  add_position_number,
ConcLineLayout  orientation,
PrintDescriptionRecord pdr,
int  nr_mappings,
Mapping mappings 
)
int get_print_attribute_values ( ContextDescriptor cd,
int  position,
char *  s,
int *  sp,
int  max_sp,
int  add_position_number,
PrintDescriptionRecord pdr 
)
ConcordanceLine MakeConcordanceLine ( Corpus corpus,
Attribute attribute,
int  focus_start_position,
int  focus_end_position,
ContextDescriptor context,
int  nr_fields,
ConcLineField fields 
)
void remember_this_position ( int  position,
int  this_token_start,
int  this_token_end,
int *  position_list,
int  nr_positions,
int *  returned_positions 
)

References nr_positions().

Referenced by compose_kwic_line().

void sort_s_att_regions ( void  )
char* srev ( char *  s)

Referenced by compose_kwic_line().


Variable Documentation

int N_sar = 0
SAttRegion s_att_regions[MAX_S_ATTRS]
int sar_sort_index[MAX_S_ATTRS]