libak
0.4.0
|
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. | |
akLexicon * | ak_lexicon_new (const akLexiconType type) |
Creates a lexicon. | |
akLexicon * | ak_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. |
enum akLexiconType |
void ak_lexicon_free | ( | akLexicon * | lexicon | ) |
Frees memory.
Frees the memory allocated for the lexicon model.
lexicon | The lexicon model. |
akLexicon* ak_lexicon_new | ( | const akLexiconType | type | ) |
Creates a lexicon.
This function creates a new empty lexicon model.
type | The type of the new lexicon. |
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.
from | File where the text description is stored. |
syms | Dictionary with the character symbols. |
emptysyms | Indicates if the provided dictionary is empty (new characters must be registered) or not (new characters are treated as errors). |
err | Pointer to string variable. If not NULL an error message is allocated in the variable 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.
lexicon | The lexicon model. |
to | File where the model is written. |
syms | Dictionary containing the characters. |