CWB
Data Structures | Typedefs | Enumerations | Functions
concordance.h File Reference
#include "../cl/corpus.h"
#include "../cl/class-mapping.h"
#include "context_descriptor.h"
#include "print-modes.h"

Data Structures

struct  _ConcLineField
 ConcLineField : a concordance line "field" is one of the four "anchors": that is, match, matchend, target, keyword. More...
 

Typedefs

typedef enum _conclinelayout ConcLineLayout
 ConcLineLayout enum represents the possible layout modes (horizontal/vertical) More...
 
typedef struct _ConcLineField ConcLineField
 ConcLineField : a concordance line "field" is one of the four "anchors": that is, match, matchend, target, keyword. More...
 

Enumerations

enum  _conclinelayout { ConcLineHorizontal, ConcLineVertical }
 ConcLineLayout enum represents the possible layout modes (horizontal/vertical) More...
 

Functions

char * compose_kwic_line (Corpus *corpus, int match_start, int match_end, ContextDescriptor *context, int *length, int *string_match_begin, int *string_match_end, 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)
 Builds a string for a concordance output line. More...
 
void cleanup_kwic_line_memory (void)
 Frees the memory used for building a KWIC line for display. More...
 

Typedef Documentation

typedef struct _ConcLineField ConcLineField

ConcLineField : a concordance line "field" is one of the four "anchors": that is, match, matchend, target, keyword.

This object contains a record of the location of one such anchor point and its type. This can be passed to a "field-printing" function to perform special rendering of tokens in the "anchor" within a concordance line.

ConcLineLayout enum represents the possible layout modes (horizontal/vertical)

Enumeration Type Documentation

ConcLineLayout enum represents the possible layout modes (horizontal/vertical)

Enumerator
ConcLineHorizontal 
ConcLineVertical 

Function Documentation

void cleanup_kwic_line_memory ( void  )

Frees the memory used for building a KWIC line for display.

Best used when CQP shuts down.

References cl_autostring_delete().

Referenced by main().

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 
)

Builds a string for a concordance output line.

'position_list' is a list of (corpus) positions. The string start and beginning positions for these corpus positions are written into returned_positions, which must be exactly two times as large as the position list. The number of positions must be in nr_positions.

Parameters
match_startA corpus position
match_endA corpus position
fieldsArray of ConcLineFields object (each of which specifies one of the 4 anchors).
nr_fieldsNumber of items in the "fields" array.

roughnotes: I THINK returned_positions is just a blob of memory that the func is being allowd to use.

Returns
String containing the output line.

References AddNameToAL(), _print_descr_rec_::AfterField, _print_descr_rec_::AfterToken, ALIGN_CONTEXT, ATT_POS, _attrbuf::attribute, _context_description_block::attributes, _print_descr_rec_::BeforeField, _print_descr_rec_::BeforeToken, CHAR_CONTEXT, TCorpus::charset, cl_alg2cpos(), cl_autostring_concat(), cl_autostring_ptr(), cl_autostring_truncate(), cl_charset_strlen(), cl_cpos2alg(), cl_cpos2struc(), cl_max_cpos(), cl_max_struc(), cl_strdup(), cl_string_utf8_continuation_byte(), cl_struc2cpos(), ConcLineHorizontal, ClAutoString::data, DEFAULT_ATT_NAME, FindInAL(), get_field_separators(), get_position_values(), get_print_attribute_values(), _context_description_block::left_structure, _context_description_block::left_type, _context_description_block::left_width, ClAutoString::len, _attlist::list, _attlist::list_valid, MAX, MAXKWICLINELEN, MIN, NewAttributeList(), _attrbuf::next, nr_positions(), _context_description_block::print_cpos, remember_this_position(), _context_description_block::right_structure, _context_description_block::right_type, _context_description_block::right_width, setup_kwic_line_memory(), srev(), _attrbuf::status, STRUC_CONTEXT, text_size, _print_descr_rec_::TokenSeparator, utf8, VerifyList(), word, and WORD_CONTEXT.

Referenced by html_print_output(), latex_print_output(), print_concordance_line(), printAlignedStrings(), and sgml_print_output().