edu.iastate.jtm.dic
Class AbstractDictionary
java.lang.Object
edu.iastate.jtm.dic.AbstractDictionary
- Direct Known Subclasses:
- HashDictionary, TrieDictionary
public abstract class AbstractDictionary
- extends java.lang.Object
- Author:
- Jing Ding
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MISMATCH
public static final int MISMATCH
- See Also:
- Constant Field Values
PARTIALMATCH
public static final int PARTIALMATCH
- See Also:
- Constant Field Values
MATCH
public static final int MATCH
- See Also:
- Constant Field Values
PARTIAL_ENTRY
public static final java.lang.String PARTIAL_ENTRY
- See Also:
- Constant Field Values
matchedValue
protected java.lang.Object matchedValue
entryCount
protected int entryCount
entryTokenizer
protected SlidingWindow entryTokenizer
tokenProcessor
protected TokenProcessor tokenProcessor
keyBuffer
protected RunningBuffer keyBuffer
tokenBuffer
protected java.nio.CharBuffer tokenBuffer
skipSpace
protected boolean skipSpace
partialAllowed
protected boolean partialAllowed
MAX_ENTRY_LENGTH
protected static final int MAX_ENTRY_LENGTH
- See Also:
- Constant Field Values
MAX_TOKEN_LENGTH
protected static final int MAX_TOKEN_LENGTH
- See Also:
- Constant Field Values
AbstractDictionary
public AbstractDictionary()
AbstractDictionary
public AbstractDictionary(boolean partial)
AbstractDictionary
public AbstractDictionary(SlidingWindow tokenizer,
boolean partial,
boolean skip)
setTokenProcessor
public void setTokenProcessor(TokenProcessor tp)
getMatchedValue
public java.lang.Object getMatchedValue()
getMatchedKey
public abstract java.lang.String getMatchedKey()
size
public int size()
readFromFile
public void readFromFile(java.io.File dicFile,
boolean keyFirst)
throws java.io.IOException
- Throws:
java.io.IOException
readFromUrl
public void readFromUrl(java.net.URL dicUrl,
boolean keyFirst)
throws java.io.IOException
- Throws:
java.io.IOException
readFromFile
public void readFromFile(java.io.File dicFile)
throws java.io.IOException
- Throws:
java.io.IOException
saveToFile
public void saveToFile(java.io.File dicFile)
throws java.io.IOException
- Throws:
java.io.IOException
addEntry
public void addEntry(java.lang.String key,
java.lang.Object val)
ensureBufferCapacity
public void ensureBufferCapacity(java.lang.CharSequence sen)
isCaseSensitive
public abstract boolean isCaseSensitive()
match
public abstract int match(java.lang.CharSequence word)
continueMatch
public abstract int continueMatch(java.lang.CharSequence word)
putEntry
public abstract void putEntry(java.lang.String key,
java.lang.Object val)
removeEntry
public abstract java.lang.Object removeEntry(java.lang.String key)
keys
public abstract java.util.Enumeration keys()
clear
public abstract void clear()