Package org.predict4all.nlp.ngram.trie
-
Class Summary Class Description AbstractNGramTrieNode<T extends AbstractNGramTrieNode<?>> Represent a node in a trie structure to represent ngrams.DynamicNGramTrieNode Represent a dynamic trie node structure : this trie node is useful when the ngram count has to be retrieved.
Dynamic trie node children are always fully loaded (they are not loaded on demand) and their frequencies can change.
Because dynamic trie node are used to be saved and loaded asStaticNGramTrieNode
orDynamicNGramTrieNode
they contains two write method :DynamicNGramTrieNode.writeStaticNode(FileChannel, int)
if they are saved to be loaded asStaticNGramTrieNode
andDynamicNGramTrieNode.writeDynamicNode(FileChannel, int)
if they are saved to be loaded asDynamicNGramTrieNode
: one save static information about the node (frequency, bow), the other only save dynamic information (count) because frequencies are dynamically computed.StaticNGramTrieNode Represent a static ngram trie node : when node are used only to retrieve information and compute probabilities, but children are never updated.
This node is particular because children node are loaded on demand from aFileChannel
.
This node is produced in a read only version : to create this node,DynamicNGramTrieNode
andTrainingNGramDictionary
should be used.