libak  0.4.0
Data Structures | Enumerations | Functions
Lexicon model
Models

Data Structures

struct  akLexicon
 Lexicon model. More...

Enumerations

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

Functions

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.

Enumerator:
AK_LEXICON_CONV 

Conventional lexicon.

AK_LEXICON_CW 

Crossword lexicon.


Function Documentation

void ak_lexicon_free ( akLexicon lexicon)

Frees memory.

Frees the memory allocated for the lexicon model.

Parameters:
lexiconThe lexicon model.

Creates a lexicon.

This function creates a new empty lexicon model.

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

Parameters:
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.
Returns:
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.

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