CWB
|
#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"
#define MAX_S_ATTRS 1024 |
#define MAXKWICLINELEN 65535 |
Referenced by compose_kwic_line().
#define SRESIZE 1024 |
Referenced by add_to_string().
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.
s | The string to modify. |
suffix | The string you want to append to s. |
sp | Index 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_sp | Size of the s array (ie, no character after s[max_sp-1] will be written to). |
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 | ||
) |
References AddNameToAL(), _print_descr_rec_::AfterField, _print_descr_rec_::AfterToken, ALIGN_CONTEXT, append(), ATT_POS, _attrbuf::attribute, _context_description_block::attributes, _print_descr_rec_::BeforeField, _print_descr_rec_::BeforeToken, CHAR_CONTEXT, cl_alg2cpos(), cl_cpos2alg(), cl_cpos2struc(), cl_max_struc(), cl_strdup(), cl_struc2cpos(), ConcLineHorizontal, DEFAULT_ATT_NAME, FindInAL(), get_attribute_size, 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, line, _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, srev(), _attrbuf::status, STRUC_CONTEXT, text_size, _print_descr_rec_::TokenSeparator, VerifyList(), word, and WORD_CONTEXT.
Referenced by html_print_output(), latex_print_output(), print_concordance_line(), printAlignedStrings(), and sgml_print_output().
void FreeConcordanceLine | ( | ConcordanceLine * | line_p | ) |
char* get_field_separators | ( | int | position, |
ConcLineField * | fields, | ||
int | nr_fields, | ||
int | at_end, | ||
PrintDescriptionRecord * | pdr | ||
) |
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 | ||
) |
Get values at the given corpus position.
References _print_descr_rec_::AfterLine, SAttRegion::annot, _Attribute::any, append(), _mapping::attribute, _attrbuf::attribute, _context_description_block::attributes, _print_descr_rec_::AttributeSeparator, CDA_OK, cderrno, cl_cpos2struc(), CL_MAX_LINE_LENGTH, cl_struc2cpos(), cl_struc2str(), cl_struc_values(), ConcLineHorizontal, ConcLineVertical, _print_descr_rec_::CPOSPrintFormat, SAttRegion::end, get_id_at_position, get_string_at_position, _attlist::list, map_id_to_class_number(), N_sar, SAttRegion::name, _attrbuf::next, _print_descr_rec_::printToken, sar_sort_index, show_tag_attributes, sort_s_att_regions(), SAttRegion::start, _attrbuf::status, _context_description_block::strucAttributes, _print_descr_rec_::StructureBeginPrefix, _print_descr_rec_::StructureBeginSuffix, _print_descr_rec_::StructureEndPrefix, _print_descr_rec_::StructureEndSuffix, and word.
Referenced by compose_kwic_line().
int get_print_attribute_values | ( | ContextDescriptor * | cd, |
int | position, | ||
char * | s, | ||
int * | sp, | ||
int | max_sp, | ||
int | add_position_number, | ||
PrintDescriptionRecord * | pdr | ||
) |
References _print_descr_rec_::AfterPrintStructures, _Attribute::any, append(), _attrbuf::attribute, _print_descr_rec_::BeforePrintStructures, CL_MAX_LINE_LENGTH, _print_descr_rec_::CPOSPrintFormat, _attlist::list, _attrbuf::next, _print_descr_rec_::PrintStructureSeparator, _context_description_block::printStructureTags, _print_descr_rec_::printToken, _attrbuf::status, structure_value_at_position(), _print_descr_rec_::StructureBeginPrefix, and _print_descr_rec_::StructureBeginSuffix.
Referenced by compose_kwic_line().
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 | ) |
References SAttRegion::end, N_sar, sar_sort_index, and SAttRegion::start.
Referenced by get_position_values().
char* srev | ( | char * | s | ) |
Referenced by compose_kwic_line().
int N_sar = 0 |
Referenced by decode_print_token_sequence(), decode_sort_s_att_regions(), get_position_values(), and sort_s_att_regions().
SAttRegion s_att_regions[MAX_S_ATTRS] |
int sar_sort_index[MAX_S_ATTRS] |
Referenced by decode_print_token_sequence(), decode_sort_s_att_regions(), get_position_values(), and sort_s_att_regions().