|
CWB
|
#include <stdio.h>#include <stdlib.h>#include "../cl/corpus.h"#include "../cl/attributes.h"#include "../cl/cdaccess.h"#include "../cl/macros.h"#include "context_descriptor.h"#include "output.h"#include "options.h"| #define RESET_LEFT_CONTEXT |
cd->left_width = 25; \
cd->left_type = CHAR_CONTEXT; \
if (cd->left_structure_name) { \
free(cd->left_structure_name); \
cd->left_structure_name = NULL; \
} \
cd->left_structure = NULL
Referenced by verify_context_descriptor().
| #define RESET_RIGHT_CONTEXT |
cd->right_width = 25; \
cd->right_type = CHAR_CONTEXT; \
if (cd->right_structure_name) { \
free(cd->right_structure_name); \
cd->right_structure_name = NULL; \
} \
cd->right_structure = NULL
Referenced by verify_context_descriptor().
| void FreeContextDescriptor | ( | ContextDescriptor ** | cdp | ) |
Referenced by initialize_cl().
| int initialize_context_descriptor | ( | ContextDescriptor * | cd | ) |
References _context_description_block::alignedCorpora, _context_description_block::attributes, CHAR_CONTEXT, _context_description_block::left_structure, _context_description_block::left_structure_name, _context_description_block::left_type, _context_description_block::left_width, _context_description_block::print_cpos, _context_description_block::printStructureTags, _context_description_block::right_structure, _context_description_block::right_structure_name, _context_description_block::right_type, _context_description_block::right_width, and _context_description_block::strucAttributes.
Referenced by init_align_module(), NewContextDescriptor(), printAlignedStrings(), and set_default_option_values().
| ContextDescriptor* NewContextDescriptor | ( | ) |
References cl_malloc(), and initialize_context_descriptor().
| void PrintAttributes | ( | FILE * | fd, |
| char * | header, | ||
| AttributeList * | al, | ||
| int | show_if_annot | ||
| ) |
attribute (selected/unselected) print helper routine
References _Attribute::any, _attrbuf::attribute, cl_struc_values(), line, _attlist::list, _attrbuf::next, and _attrbuf::status.
Referenced by PrintContextDescriptor().
| void PrintAttributesSimple | ( | FILE * | fd, |
| char * | type, | ||
| AttributeList * | al, | ||
| int | show_if_annot | ||
| ) |
attribute print helper routine (non pretty-printing mode)
References _Attribute::any, _attrbuf::attribute, cl_struc_values(), _attlist::list, and _attrbuf::next.
Referenced by PrintContextDescriptor().
| void PrintContextDescriptor | ( | ContextDescriptor * | cdp | ) |
References ALIGN_CONTEXT, _context_description_block::alignedCorpora, ascii, _context_description_block::attributes, CHAR_CONTEXT, close_stream(), _context_description_block::left_structure_name, _context_description_block::left_type, _context_description_block::left_width, open_stream(), pretty_print, _context_description_block::print_cpos, PrintAttributes(), PrintAttributesSimple(), _context_description_block::right_structure_name, _context_description_block::right_type, _context_description_block::right_width, show_targets, Redir::stream, STRUC_CONTEXT, _context_description_block::strucAttributes, and WORD_CONTEXT.
| int update_context_descriptor | ( | Corpus * | corpus, |
| ContextDescriptor * | cd | ||
| ) |
References _context_description_block::alignedCorpora, ATT_ALIGN, ATT_POS, ATT_STRUC, _context_description_block::attributes, find_attribute, _attlist::list, _attrbuf::name, NewAttributeList(), _attrbuf::next, _context_description_block::printStructureTags, RecomputeAL(), RemoveNameFromAL(), _context_description_block::strucAttributes, and structure_has_values.
Referenced by printAlignedStrings(), and set_current_corpus().
| int verify_context_descriptor | ( | Corpus * | corpus, |
| ContextDescriptor * | cd, | ||
| int | remove_illegal_entries | ||
| ) |
Verify the current context settings against the current corpus: check whether structures are still valid, and reset them to defaults if not.
returns 1 if all keeps the same, 0 otherwise. The string fields in CD are supposed to be malloced and freed.
References ALIGN_CONTEXT, _context_description_block::alignedCorpora, ATT_ALIGN, ATT_STRUC, _context_description_block::attributes, cqpmessage(), DestroyAttributeList(), find_attribute, _context_description_block::left_structure, _context_description_block::left_structure_name, _context_description_block::left_type, _context_description_block::left_width, _attlist::list, _context_description_block::printStructureTags, RESET_LEFT_CONTEXT, RESET_RIGHT_CONTEXT, _context_description_block::right_structure, _context_description_block::right_structure_name, _context_description_block::right_type, _context_description_block::right_width, STRUC_CONTEXT, _context_description_block::strucAttributes, VerifyList(), and Warning.
Referenced by catalog_corpus().
1.7.3