edu.iastate.jtm.dic
Class HashDictionary

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

public class HashDictionary
extends AbstractDictionary

A dictionary backed with a hashtable.

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
HashDictionary()
          Creates a new instance of HashDictionary
HashDictionary(boolean caseSense)
           
HashDictionary(SlidingWindow tokenizer, boolean partial, boolean skipSpace, boolean caseSense)
           
 
Method Summary
 void clear()
           
 int continueMatch(java.lang.CharSequence word)
           
 java.lang.String getMatchedKey()
           
 boolean isCaseSensitive()
           
 java.util.Enumeration keys()
           
static void main(java.lang.String[] args)
           
 int match(java.lang.CharSequence word)
           
 void putEntry(java.lang.String key, java.lang.Object val)
           
 java.lang.Object removeEntry(java.lang.String key)
           
 
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

HashDictionary

public HashDictionary()
Creates a new instance of HashDictionary


HashDictionary

public HashDictionary(boolean caseSense)

HashDictionary

public HashDictionary(SlidingWindow tokenizer,
                      boolean partial,
                      boolean skipSpace,
                      boolean caseSense)
Method Detail

isCaseSensitive

public boolean isCaseSensitive()
Specified by:
isCaseSensitive 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

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

getMatchedKey

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

clear

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

keys

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

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments