libTLK  1.3.1
Data Structures | Enumerations | Functions
Lexicon model
Models

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.

Enumeration Type Documentation

Type of Lexicon.

Enumerator:
TL_LEXICON_CONV 

Conventional lexicon.

TL_LEXICON_CW 

Crossword lexicon.


Function Documentation

tL_lexicon_free ( tLLexicon lexicon)

Frees memory.

Frees the memory allocated for the lexicon model.

Parameters:
lexiconThe lexicon model.
tL_lexicon_new ( const tLLexiconType  type)

Creates a lexicon.

This function creates a new empty lexicon model.

Parameters:
typeThe type of the new lexicon.
Returns:
The lexicon model.
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.

Parameters:
fromFile where the text description is stored.
symsDictionary with the symbols.
emptysymsSpecifies whether the provided dictionary is empty (new symbols must be registered) or not (new symbols are treated as errors).
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
The lexicon model, or NULL 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.

Parameters:
lexiconThe lexicon model.
toFile to which the model will be written.
symsDictionary containing the symbols.
 All Data Structures Variables