StringLookup Class Reference
Public Member Functions | |
StringLookup (int numberOfWords, char **vocabulary) | |
~StringLookup () | |
int | getWordID (char *word) |
Protected Member Functions | |
void | deleteWordTree (WordStringNode *w) |
Protected Attributes | |
WordStringNode * | wordTree |
Detailed Description
- Todo:
- Docs
Constructor & Destructor Documentation
StringLookup::StringLookup | ( | int | numberOfWords, | |
char ** | vocabulary | |||
) |
Creates a tree-structure of all words. This will make getWordID a lot faster, but it costs memory!
References WordStringNode::c, WordStringNode::next, WordStringNode::par, WordStringNode::wordID, and wordTree.
StringLookup::~StringLookup | ( | ) |
Member Function Documentation
void StringLookup::deleteWordTree | ( | WordStringNode * | w | ) | [protected] |
Deletes the word tree.
References WordStringNode::next, and WordStringNode::par.
Referenced by ~StringLookup().
int StringLookup::getWordID | ( | char * | word | ) |
Returns the ID of the word 'word'. If the word is not in the vocabulary (OOV), -1 is returned.
References WordStringNode::c, WordStringNode::next, WordStringNode::par, WordStringNode::wordID, and wordTree.
Referenced by ShoutConfig::fillParameter(), and Shout_lm2bin::Shout_lm2bin().
Member Data Documentation
WordStringNode* StringLookup::wordTree [protected] |
Referenced by getWordID(), StringLookup(), and ~StringLookup().