edu.iastate.jtm.dic
Class TrieDictionary

java.lang.Object
  extended by edu.iastate.jtm.dic.AbstractDictionary
      extended by edu.iastate.jtm.dic.TrieDictionary

public class TrieDictionary
extends AbstractDictionary

A dictionary backed with a trie.

Author:
Jing Ding

Field Summary
 
Fields inherited from class edu.iastate.jtm.dic.AbstractDictionary
entryCount, entryTokenizer, keyBuffer, MATCH, matchedValue, MAX_ENTRY_LENGTH, MAX_TOKEN_LENGTH, MISMATCH, PARTIAL_ENTRY, partialAllowed, PARTIALMATCH, skipSpace, tokenBuffer, tokenProcessor
 
Constructor Summary
TrieDictionary(Trie trie)
          Creates a new instance of TrieDictionary
TrieDictionary(Trie trie, boolean partial)
           
TrieDictionary(Trie trie, SlidingWindow tokenizer, boolean partial, boolean skipSpace)
           
 
Method Summary
 void clear()
           
 int continueMatch(java.lang.CharSequence word)
           
 java.lang.String getMatchedKey()
           
 TrieNode getPreMatchedNode()
           
 boolean isCaseSensitive()
           
 java.util.Enumeration keys()
           
 int match(java.lang.CharSequence word)
           
 void putEntry(java.lang.String key, java.lang.Object val)
           
 java.lang.Object removeEntry(java.lang.String key)
           
 void setPreMatchedNode(TrieNode pmn)
           
 
Methods inherited from class edu.iastate.jtm.dic.AbstractDictionary
addEntry, ensureBufferCapacity, getMatchedValue, readFromFile, readFromFile, readFromUrl, saveToFile, setTokenProcessor, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrieDictionary

public TrieDictionary(Trie trie)
Creates a new instance of TrieDictionary


TrieDictionary

public TrieDictionary(Trie trie,
                      boolean partial)

TrieDictionary

public TrieDictionary(Trie trie,
                      SlidingWindow tokenizer,
                      boolean partial,
                      boolean skipSpace)
Method Detail

continueMatch

public int continueMatch(java.lang.CharSequence word)
Specified by:
continueMatch in class AbstractDictionary

match

public int match(java.lang.CharSequence word)
Specified by:
match in class AbstractDictionary

putEntry

public void putEntry(java.lang.String key,
                     java.lang.Object val)
Specified by:
putEntry in class AbstractDictionary

removeEntry

public java.lang.Object removeEntry(java.lang.String key)
Specified by:
removeEntry in class AbstractDictionary

clear

public void clear()
Specified by:
clear in class AbstractDictionary

isCaseSensitive

public boolean isCaseSensitive()
Specified by:
isCaseSensitive in class AbstractDictionary

keys

public java.util.Enumeration keys()
Specified by:
keys in class AbstractDictionary

getMatchedKey

public java.lang.String getMatchedKey()
Specified by:
getMatchedKey in class AbstractDictionary

getPreMatchedNode

public TrieNode getPreMatchedNode()

setPreMatchedNode

public void setPreMatchedNode(TrieNode pmn)