CWB
Functions | Variables
print_align.c File Reference
#include <stdio.h>
#include "../cl/cl.h"
#include "../cl/corpus.h"
#include "../cl/attributes.h"
#include "../cl/cdaccess.h"
#include "../cl/macros.h"
#include "concordance.h"
#include "cqp.h"
#include "options.h"
#include "corpmanag.h"
#include "print-modes.h"
#include "context_descriptor.h"
#include "ascii-print.h"
#include "html-print.h"
#include "sgml-print.h"
#include "latex-print.h"

Functions

void init_align_module ()
 Initialises the alignment-printing module by setting up the static global ContextDescriptor (internal to print_align module). More...
 
void printAlignedStrings (Corpus *sourceCorpus, ContextDescriptor *cd, int begin_target, int end_target, int highlighting, FILE *stream)
 For a given query result, prints the corresponding section of the aligned corpus (if any). More...
 

Variables

static int module_init = 0
 Flag for whether the "print_align" module has been initialised yet or not. More...
 
static ContextDescriptor AlignedCorpusCD
 Global context descriptor used solely for the printing of corresponding strings from an aligned corpus. More...
 

Function Documentation

void init_align_module ( )

Initialises the alignment-printing module by setting up the static global ContextDescriptor (internal to print_align module).

See also
AlignedCorpusCD

References initialize_context_descriptor(), _context_description_block::left_type, module_init, _context_description_block::right_type, and WORD_CONTEXT.

Referenced by printAlignedStrings().

void printAlignedStrings ( Corpus sourceCorpus,
ContextDescriptor cd,
int  begin_target,
int  end_target,
int  highlighting,
FILE *  stream 
)

For a given query result, prints the corresponding section of the aligned corpus (if any).

This function is the business-end of the "print_align" module.

Parameters
sourceCorpusThe corpus the query was run on.
cdContextDescriptor containing data on how the concordance is to be printed.
begin_targetStarting cpos of the result being printed.
end_targetEnding cpos of the result being printed.
highlightingBoolean: Iff true, highlighting will be used (applies only in ASCII print mode; see "ascii_print_aligned_line").
streamOutput destination stream (will be printed to).

References _context_description_block::alignedCorpora, ascii, ascii_print_aligned_line(), ASCIIPrintDescriptionRecord, ATT_ALIGN, _context_description_block::attributes, TCorpus::charset, cl_alg2cpos(), cl_cpos2alg(), cl_free, cl_new_corpus(), cl_strdup(), cl_string_validate_encoding(), compose_kwic_line(), ConcLineHorizontal, find_attribute, FindInAL(), GlobalPrintMode, html_print_aligned_line(), HTMLPrintDescriptionRecord, init_align_module(), initialize_context_descriptor(), latex_print_aligned_line(), LaTeXPrintDescriptionRecord, _attlist::list, module_init, _attrbuf::name, _attrbuf::next, PrintASCII, PrintBINARY, PrintHTML, PrintLATEX, PrintSGML, PrintUNKNOWN, registry, sgml_print_aligned_line(), SGMLPrintDescriptionRecord, _attrbuf::status, _context_description_block::strucAttributes, update_context_descriptor(), and utf8.

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

Variable Documentation

ContextDescriptor AlignedCorpusCD
static

Global context descriptor used solely for the printing of corresponding strings from an aligned corpus.

int module_init = 0
static

Flag for whether the "print_align" module has been initialised yet or not.

Referenced by init_align_module(), and printAlignedStrings().