Data Fields | |
LexicalMemoryHandler(* | create )(const LexicalDataType type) |
Lexical memory constructor. | |
void(* | free )(LexicalMemoryHandler lexical_memory) |
Free and destroy a lexical memory (destructor). | |
int(* | export )(const LexicalMemoryHandler lexical_memory, const char *filename) |
Export the content of a lexical memory. | |
int(* | import )(LexicalMemoryHandler lexical_memory, const char *filename) |
Import the content of a lexical memory. | |
int(* | save )(const LexicalMemoryHandler lexical_memory, const char *filename) |
Save a lexical memory in a file. | |
int(* | load )(LexicalMemoryHandler lexical_memory, const char *filename) |
Load a lexical memory from a file. | |
int(* | dump )(const LexicalMemoryHandler lexical_memory, int(*print)(const char *,...)) |
Dump the content of a lexical memory. | |
InsertionResult(* | insert )(LexicalMemoryHandler lexical_memory, const LexicalEntry entry) |
Insert a new entry in a lexical memory. | |
size_t(* | getSize )(const LexicalMemoryHandler lexical_memory) |
Return the size of a lexical memory. | |
LexicalSearch(* | searchFirst )(const LexicalMemoryHandler lexical_memory, const LexicalEntry entry) |
Search the first occurence of a graphy in a lexical memory. | |
gboolean(* | searchNext )(LexicalSearch *search) |
Search the next occurence of a graphy in a lexical memory. | |
void(* | uniqIdToLexicalSearch )(const LexicalMemoryHandler lexical_memory, const UniqId uid, LexicalSearch *output) |
Converts a UniqId to a LexicalSearch. | |
LexicalEntry(* | getNextEntry )(LexicalMemoryHandler lexical_memory) |
Return the next graphy stored in a lexical memory. | |
void(* | goToFirstEntry )(LexicalMemoryHandler lexical_memory) |
Go back to the first graphy stored in a lexical memory. | |
LexicalCharacter(* | getNextAvailableCharacter )(LexicalMemoryHandler lexical_memory) |
Return the next character available at the current position. | |
void(* | goToRoot )(LexicalMemoryHandler lexical_memory) |
Set the current position to the root of the lexical memory. | |
void(* | goCharacterForward )(LexicalMemoryHandler lexical_memory) |
Step one lexical character forward the current position. | |
void(* | goCharacterBackward )(LexicalMemoryHandler lexical_memory) |
Step one lexical character backward the current position. | |
gboolean(* | isAtEndOfGraphy )(const LexicalMemoryHandler lexical_memory) |
Tell if the current position corresponds to a stored entry. | |
UniqId(* | getCurrentGraphyUniqId )(const LexicalMemoryHandler lexical_memory) |
Return the unique identifier associated to the current position. | |
size_t(* | getCurrentGraphyLength )(const LexicalMemoryHandler lexical_memory) |
Return the length of the current word. | |
LexicalDataType(* | getDataType )(const LexicalMemoryHandler lexical_memory) |
Tell the kind of lexical memory. |
Set of functions that a lexical access table must implement
Lexical memory constructor.
Allocate the memory and initialize a new lexical memory implementation.
[in] | type | The data type entries to store in the memory |
int(* LexicalAccessTableFunctions::dump)(const LexicalMemoryHandler lexical_memory, int(*print)(const char *,...)) |
Dump the content of a lexical memory.
Dump the content of a lexical memory using a given print function. The function returns a not null error code if operation fails.
[in] | lexical_memory | The lexical memory to dump |
[in] | The print function to use |
int(* LexicalAccessTableFunctions::export)(const LexicalMemoryHandler lexical_memory, const char *filename) |
Export the content of a lexical memory.
Save the content of a lexical memory in a textual (human readable) file. The function returns a not null error code if operation fails.
[in] | lexical_memory | The lexical memory to export |
[in] | filename | The name of the output file |
void(* LexicalAccessTableFunctions::free)(LexicalMemoryHandler lexical_memory) |
Free and destroy a lexical memory (destructor).
Destroy and free the memory allocated to a lexical memory
[in] | lexical_memory | The lexical memory to free |
size_t(* LexicalAccessTableFunctions::getCurrentGraphyLength)(const LexicalMemoryHandler lexical_memory) |
Return the length of the current word.
Return the length of the word associated to the current exploring position
0
at every goToRoot call.[in] | lexical_memory | The lexical memory to explore |
UniqId(* LexicalAccessTableFunctions::getCurrentGraphyUniqId)(const LexicalMemoryHandler lexical_memory) |
Return the unique identifier associated to the current position.
Return the identifier of the word corresponding to the current exploring position.
0
.[in] | lexical_memory | The lexical memory to explore |
LexicalDataType(* LexicalAccessTableFunctions::getDataType)(const LexicalMemoryHandler lexical_memory) |
Tell the kind of lexical memory.
Return the data type of the entries stored in the lexical memory
[in] | lexical_memory | The lexical memory to identify |
LexicalCharacter(* LexicalAccessTableFunctions::getNextAvailableCharacter)(LexicalMemoryHandler lexical_memory) |
Return the next character available at the current position.
Iteratively return all the lexical characters available from the current exploring position. This function can be called until its returns NO_CHARACTER, signifying that all possible characters have been returned. At this point, a further call to getNextAvailableCharacter
goes back to the first lexical character available.
[in] | lexical_memory | The lexical memory to explore |
LexicalEntry(* LexicalAccessTableFunctions::getNextEntry)(LexicalMemoryHandler lexical_memory) |
Return the next graphy stored in a lexical memory.
Iteratively return all the graphies stored in a lexical memory. This function can be called until its returns NULL
, signifying that all stored graphies have been returned.
[in] | lexical_memory | The lexical memory to make an inventory of |
size_t(* LexicalAccessTableFunctions::getSize)(const LexicalMemoryHandler lexical_memory) |
Return the size of a lexical memory.
Return the number of entries stored in a lexical memory
[in] | lexical_memory | The lexical memory |
void(* LexicalAccessTableFunctions::goCharacterBackward)(LexicalMemoryHandler lexical_memory) |
Step one lexical character backward the current position.
Step backward the current exploring position from one lexical character. The exploring informations of the position before the call are lost so that when one goes back to that position, available characters inventory start again from the beginning.
[in] | lexical_memory | The lexical memory to explore |
void(* LexicalAccessTableFunctions::goCharacterForward)(LexicalMemoryHandler lexical_memory) |
Step one lexical character forward the current position.
Step forward the current exploring position from one lexical character, that is the value returned by the last call of getNextAvailableCharacter from the current exploring position. Each time this function is called, the current state is saved so that when one go back to a given exploring position using goCharacterBackward, the available characters inventory with getNextAvailableCharacter carries on as if the current position had not been left.
[in] | lexical_memory | The lexical memory to explore |
void(* LexicalAccessTableFunctions::goToFirstEntry)(LexicalMemoryHandler lexical_memory) |
Go back to the first graphy stored in a lexical memory.
This function can be called anytime to order to start again the lexical memory inventory (with getNextEntry) from the beginning.
[in] | lexical_memory | The lexical memory to make an inventory of |
void(* LexicalAccessTableFunctions::goToRoot)(LexicalMemoryHandler lexical_memory) |
Set the current position to the root of the lexical memory.
Assign the current exploring position to the root of the lexical memory, i.e. before the first lexical character.
[in] | lexical_memory | The lexical memory to explore |
int(* LexicalAccessTableFunctions::import)(LexicalMemoryHandler lexical_memory, const char *filename) |
Import the content of a lexical memory.
Load a lexical memory with the content of a textual (human readable) file. The function returns a not null error code if operation fails.
[out] | lexical_memory | The lexical memory where to import |
[in] | filename | The name of the input file |
InsertionResult(* LexicalAccessTableFunctions::insert)(LexicalMemoryHandler lexical_memory, const LexicalEntry entry) |
Insert a new entry in a lexical memory.
Insert a new lexical entry (graphy) into lexical memory. The function returns an insertion result whose nature may vary from one implementation to another.
[in] | lexical_memory | The lexical memory |
[in] | entry | The graphy of the entry to insert |
gboolean(* LexicalAccessTableFunctions::isAtEndOfGraphy)(const LexicalMemoryHandler lexical_memory) |
Tell if the current position corresponds to a stored entry.
[in] | lexical_memory | The lexical memory to explore |
int(* LexicalAccessTableFunctions::load)(LexicalMemoryHandler lexical_memory, const char *filename) |
Load a lexical memory from a file.
Load a lexical memory from a binary (machine readable) save file. The function returns a not null error code if operation fails.
[out] | lexical_memory | The lexical memory where to load |
[in] | filename | The name of the output file |
int(* LexicalAccessTableFunctions::save)(const LexicalMemoryHandler lexical_memory, const char *filename) |
Save a lexical memory in a file.
Save the content of a lexical memory in a binary (machine readable) file. The function returns a not null error code if operation fails.
[in] | lexical_memory | The lexical memory to save |
[in] | filename | The name of the output file |
LexicalSearch(* LexicalAccessTableFunctions::searchFirst)(const LexicalMemoryHandler lexical_memory, const LexicalEntry entry) |
Search the first occurence of a graphy in a lexical memory.
Search the information related to the first entry corresponding to a given graphy. The LexicalSearch::found field informs if such graphy has been found or not. If yes, other corresponding entries can be iteratively recovered using searchNext.
[in] | lexical_memory | The lexical memory where to search |
[in] | entry | The graphy to search |
gboolean(* LexicalAccessTableFunctions::searchNext)(LexicalSearch *search) |
Search the next occurence of a graphy in a lexical memory.
Carry on a search process initiate by searchFirst. This function can be iteratively called until its returns FALSE
, signifying that all relevant entries have been returned.
[in] | search | The search result to update |
void(* LexicalAccessTableFunctions::uniqIdToLexicalSearch)(const LexicalMemoryHandler lexical_memory, const UniqId uid, LexicalSearch *output) |
Converts a UniqId to a LexicalSearch.
Converts an entry uniq identifier to the first corresponding LexicalSearch information. Notice however that the fields "found_length" and "specific.code" of the corresponding LexicalSearch are undefined in this context (and should thus not be used after).
[in] | lexical_memory | The corresponding lexical memory |
[in] | uid | The UniqId to be converted |
[in] | output | The LexicalSearch value to be updated |