libTLK
1.3.1
|
Data Structures | |
struct | tLLexicon |
Lexicon model. More... | |
Enumerations | |
enum | tLLexiconType { TL_LEXICON_CONV, TL_LEXICON_CW } |
Type of Lexicon. More... | |
Functions | |
tL_lexicon_free (tLLexicon *lexicon) | |
Frees memory. | |
tL_lexicon_new (const tLLexiconType type) | |
Creates a lexicon. | |
tL_lexicon_new_from_file (gzFile from, tLDict *syms, const tLBool emptysyms, char **err) | |
Reads a lexicon model from a file. | |
tL_lexicon_print (const tLLexicon *lexicon, FILE *to, const tLDict *syms) | |
Prints the lexicon model. |
enum tLLexiconType |
tL_lexicon_free | ( | tLLexicon * | lexicon | ) |
Frees memory.
Frees the memory allocated for the lexicon model.
lexicon | The lexicon model. |
tL_lexicon_new | ( | const tLLexiconType | type | ) |
Creates a lexicon.
This function creates a new empty lexicon model.
type | The type of the new lexicon. |
tL_lexicon_new_from_file | ( | gzFile | from, |
tLDict * | syms, | ||
const tLBool | emptysyms, | ||
char ** | err | ||
) |
Reads a lexicon model from a file.
This function creates a new lexicon model from a text description. The provided dictionary is the dictionary of symbols.
from | File where the text description is stored. |
syms | Dictionary with the symbols. |
emptysyms | Specifies whether the provided dictionary is empty (new symbols must be registered) or not (new symbols are treated as errors). |
err | Pointer to string variable. If not NULL, an error message is allocated in the variable in case of error. |
tL_lexicon_print | ( | const tLLexicon * | lexicon, |
FILE * | to, | ||
const tLDict * | syms | ||
) |
Prints the lexicon model.
This function writes to the given file the content of the lexicon model, using the provided symbol dictionary. The provided symbol dictionary is assumed to contain all required symbols, otherwise an unexpected error could happen.
lexicon | The lexicon model. |
to | File to which the model will be written. |
syms | Dictionary containing the symbols. |