libak  0.4.0
Data Structures | Enumerations | Functions
Lexicon model

Data Structures

struct  akLexicon
 Lexicon model. More...


enum  akLexiconType { AK_LEXICON_CONV, AK_LEXICON_CW }
 Type of Lexicon. More...


void ak_lexicon_free (akLexicon *lexicon)
 Frees memory.
akLexiconak_lexicon_new (const akLexiconType type)
 Creates a lexicon.
akLexiconak_lexicon_new_from_file (FILE *from, akDict *syms, const akBool emptysyms, char **err)
 Reads a lexicon model from a file.
void ak_lexicon_print (const akLexicon *lexicon, FILE *to, const akDict *syms)
 Prints the lexicon model.

Enumeration Type Documentation

Type of Lexicon.


Conventional lexicon.


Crossword lexicon.

Function Documentation

void ak_lexicon_free ( akLexicon lexicon)

Frees memory.

Frees the memory allocated for the lexicon model.

lexiconThe lexicon model.

Creates a lexicon.

This function creates a new empty lexicon model.

typeThe type of the new lexicon.
The lexicon model.
akLexicon* ak_lexicon_new_from_file ( FILE *  from,
akDict syms,
const akBool  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 character symbols.

fromFile where the text description is stored.
symsDictionary with the character symbols.
emptysymsIndicates if the provided dictionary is empty (new characters must be registered) or not (new characters are treated as errors).
errPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
The lexicon model, or NULL in case of error.
void ak_lexicon_print ( const akLexicon lexicon,
FILE *  to,
const akDict syms 

Prints the lexicon model.

This function writes in the given file the content of the lexicon model, using the provided character dictionary. The provided character dictionary is supposed to contain all needed characters, in another case an unexpected error could happen.

lexiconThe lexicon model.
toFile where the model is written.
symsDictionary containing the characters.
 All Data Structures Variables