CWB
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "../cl/globals.h"
Macros | |
#define | MIN_COL_WIDTH 20 |
#define | MAX_COL_WIDTH 256 |
#define | WIDE_COL_WIDTH 55 |
wider column width available on request (-W option) More... | |
#define | WIDE_COL_SEP 6 |
column separator to accompany the wider columns More... | |
Functions | |
void | alignshow_print_help (void) |
Lists interactive commands on STDERR. More... | |
void | alignshow_usage (void) |
Prints a message describing how to use the program to STDERR and then exits. More... | |
int | alignshow_parse_args (int ac, char *av[], int min_args) |
Parses the program's commandline arguments. More... | |
void | alignshow_goodbye (int error_level) |
Closes the alignment file handle (if open) and exits the program. More... | |
void | alignshow_end_of_alignment (void) |
Exits the program because the end of the .align file has been reached. More... | |
void | alignshow_skip_next_region (FILE *f) |
Reads and discards the next alignment region from an .align file. More... | |
void | alignshow_print_next_region (FILE *f) |
Reads the next alignment region from a .align file, and displays it on STDOUT. More... | |
int | main (int argc, char **argv) |
Main function for cwb-align-show. More... | |
Variables | |
char * | progname = "" |
Name of the program (from the shell) More... | |
char | corpus1_name [CL_MAX_FILENAME_LENGTH] |
name of the source corpus More... | |
char | corpus2_name [CL_MAX_FILENAME_LENGTH] |
name of the target corpus More... | |
char | s1_name [CL_MAX_FILENAME_LENGTH] |
name of the source sentence regions More... | |
char | s2_name [CL_MAX_FILENAME_LENGTH] |
name of the target sentence regions More... | |
char | word_name [CL_MAX_FILENAME_LENGTH] = "word" |
name of the p-attribute used to display tokens (usually word) More... | |
Corpus * | corpus1 |
corpus handle: source corpus More... | |
Corpus * | corpus2 |
corpus handle: target corpus More... | |
Attribute * | w1 |
{word} attribute (or whatever is selected with -P) handle: source More... | |
Attribute * | s1 |
sentence attribute handle: source More... | |
Attribute * | w2 |
{word} attribute (or whatever is selected with -P) handle: target More... | |
Attribute * | s2 |
sentence attribute handle: target More... | |
char * | registry_dir = NULL |
registry directory (NULL = use CL default) More... | |
char * | align_name = "" |
name of the .align file More... | |
FILE * | af = NULL |
file handle .align file More... | |
int | COL_WIDTH = 38 |
width of a display column (one column for each language) More... | |
int | COL_SEP = 2 |
column separator (blanks) More... | |
#define MAX_COL_WIDTH 256 |
Referenced by alignshow_parse_args(), and alignshow_print_next_region().
#define MIN_COL_WIDTH 20 |
Referenced by alignshow_parse_args().
#define WIDE_COL_SEP 6 |
column separator to accompany the wider columns
Referenced by alignshow_parse_args().
#define WIDE_COL_WIDTH 55 |
wider column width available on request (-W option)
Referenced by alignshow_parse_args().
void alignshow_end_of_alignment | ( | void | ) |
Exits the program because the end of the .align file has been reached.
References alignshow_goodbye().
Referenced by alignshow_print_next_region(), and alignshow_skip_next_region().
void alignshow_goodbye | ( | int | error_level | ) |
Closes the alignment file handle (if open) and exits the program.
error_level | The exit code that is returned to the OS. |
References af, and cl_close_stream().
Referenced by alignshow_end_of_alignment(), and main().
int alignshow_parse_args | ( | int | ac, |
char * | av[], | ||
int | min_args | ||
) |
Parses the program's commandline arguments.
Usage: optindex = alignshow_parse_args(argc, argv, required_arguments);
ac | The program's argc |
av | The program's argv |
min_args | Minimum number of arguments to be parsed. |
References alignshow_usage(), COL_SEP, COL_WIDTH, MAX_COL_WIDTH, MIN_COL_WIDTH, progname, registry_dir, WIDE_COL_SEP, WIDE_COL_WIDTH, and word_name.
Referenced by main().
void alignshow_print_help | ( | void | ) |
Lists interactive commands on STDERR.
References progname.
Referenced by alignshow_usage(), and main().
void alignshow_print_next_region | ( | FILE * | f | ) |
Reads the next alignment region from a .align file, and displays it on STDOUT.
f | The file handle to read from. |
References alignshow_end_of_alignment(), cl_cpos2str(), CL_MAX_LINE_LENGTH, COL_SEP, COL_WIDTH, line, MAX_COL_WIDTH, progname, and word.
Referenced by main().
void alignshow_skip_next_region | ( | FILE * | f | ) |
Reads and discards the next alignment region from an .align file.
f | The file handle to read from. |
References alignshow_end_of_alignment(), CL_MAX_LINE_LENGTH, and line.
Referenced by main().
void alignshow_usage | ( | void | ) |
Prints a message describing how to use the program to STDERR and then exits.
References alignshow_print_help(), COL_SEP, COL_WIDTH, progname, and VERSION.
Referenced by alignshow_parse_args().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main function for cwb-align-show.
argc | Number of command-line arguments. |
argv | Command-line arguments. |
References af, align_name, alignshow_goodbye(), alignshow_parse_args(), alignshow_print_help(), alignshow_print_next_region(), alignshow_skip_next_region(), ATT_POS, ATT_STRUC, CL_MAX_LINE_LENGTH, cl_new_attribute, cl_new_corpus(), cl_open_stream(), CL_STREAM_MAGIC, CL_STREAM_READ, corpus1_name, corpus2_name, line, progname, registry_dir, s1_name, s2_name, and word_name.
FILE* af = NULL |
file handle .align file
Referenced by alignshow_goodbye(), and main().
char* align_name = "" |
name of the .align file
Referenced by main().
int COL_SEP = 2 |
column separator (blanks)
Referenced by alignshow_parse_args(), alignshow_print_next_region(), and alignshow_usage().
int COL_WIDTH = 38 |
width of a display column (one column for each language)
Referenced by alignshow_parse_args(), alignshow_print_next_region(), and alignshow_usage().
char corpus1_name[CL_MAX_FILENAME_LENGTH] |
name of the source corpus
Referenced by main().
char corpus2_name[CL_MAX_FILENAME_LENGTH] |
name of the target corpus
Referenced by main().
char* progname = "" |
Name of the program (from the shell)
Referenced by alignshow_parse_args(), alignshow_print_help(), alignshow_print_next_region(), alignshow_usage(), and main().
char* registry_dir = NULL |
registry directory (NULL = use CL default)
Referenced by alignshow_parse_args(), and main().
Attribute* s1 |
sentence attribute handle: source
Referenced by cl_set_intersection(), cl_string_qsort_compare(), do_cqi_cl_alg2cpos(), do_translate(), group2compare(), and i2compare().
char s1_name[CL_MAX_FILENAME_LENGTH] |
name of the source sentence regions
Referenced by main().
Attribute* s2 |
sentence attribute handle: target
Referenced by cl_set_intersection(), cl_string_qsort_compare(), do_cqi_cl_alg2cpos(), do_translate(), group2compare(), and i2compare().
char s2_name[CL_MAX_FILENAME_LENGTH] |
name of the target sentence regions
Referenced by main().
Attribute* w1 |
{word} attribute (or whatever is selected with -P) handle: source
Referenced by compare_cells(), and main().
Attribute* w2 |
{word} attribute (or whatever is selected with -P) handle: target
Referenced by compare_cells(), and main().
char word_name[CL_MAX_FILENAME_LENGTH] = "word" |
name of the p-attribute used to display tokens (usually word)
Referenced by alignshow_parse_args(), and main().