#include <math.h>
#include "../cl/globals.h"
#include "../cl/cl.h"
#include "../cl/corpus.h"
#include "../cl/attributes.h"
#include "../cl/macros.h"
void do_show | ( | char * | attr_name, | |
char * | rx, | |||
int | rx_flags | |||
) |
Prints out the lexicon of a P-attribute.
This is the business end of the cwb-lexdecode program.
attr_name | Name of the attribute to decode. | |
rx | A regex that items must match to be printed. NULL if no regex is to be specified. | |
rx_flags | IGNORE_CASE; IGNORE_DIAC; both; or neither. |
References ATT_POS, CDA_OK, cderrno, cdperror(), cl_max_cpos, cl_max_id, cl_new_attribute, cl_regex2id, cl_str2id, corpus_id, freq_0_if_unknown, get_id_from_sortidx(), input_are_numbers, input_fd, input_filename, print_info(), progname, show_size_only, and sort.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Main function for cwb-lexdecode.
argc | Number of command-line arguments. | |
argv | Command-line arguments. |
References central_corpus_directory(), cl_delete_corpus, cl_new_corpus, cl_set_optimize(), corpus_id, DEFAULT_ATT_NAME, do_show(), freq_0_if_unknown, IGNORE_CASE, IGNORE_DIAC, input_are_numbers, input_filename, print_freqs, print_len, print_nr, progname, registry_directory, show_size_only, sort, and usage().
void print_info | ( | Attribute * | attr, | |
int | id, | |||
char * | fallback_s | |||
) |
Prints information about a specified item on a P-attribute.
attr | The attribute to search | |
id | The id number of the item (type) in question | |
fallback_s | String to print if the item is not found (use NULL to use a default fallback string) |
References CDA_OK, cderrno, cdperror(), get_id_info(), print_freqs, print_len, and print_nr.
Referenced by do_show().
void usage | ( | void | ) |
Prints a message describing how to use the program to STDERR and then exits.
References progname.
char* corpus_id = NULL |
int freq_0_if_unknown = 0 |
int input_are_numbers = 0 |
char* input_filename = NULL |
int print_freqs = 0 |
boolean: print the frequencies of the words?
Referenced by main(), and print_info().
int print_len = 0 |
boolean: print the word length s?
Referenced by main(), and print_info().
int print_nr = 0 |
boolean: flag whether we should print line numbers
Referenced by main(), and print_info().
char* progname |
String set to the name of this program.
int show_size_only = 0 |