|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.uima.annotator.dict_annot.dictionary.impl.HashMapDictionary
public class HashMapDictionary
HashMap dictionary implementation. Implements the Dictionary interface using a simple HashMap for the lookup. Each word added to the dictionary is added to the main dictionary HashMap with some additional meta data information. In case of multi-words the multi word parts are added as tree to the dictionary.
| Constructor Summary | |
|---|---|
HashMapDictionary(boolean caseNormalization)
Creates a new HashMapDictionary object with an initial capacity of 100 entries. |
|
| Method Summary | |
|---|---|
int |
addMultiWord(String[] multiWord)
Adds a new multi-word to the dictionary |
int |
addWord(String word)
Adds a new word to the dictionary. |
boolean |
contains(String word)
Checks if the given word is available in the dictionary. |
boolean |
contains(String[] multiWord)
Checks if the given multi word is available in the dictionary. |
int |
getEntryCount()
Returns the number of entries that are stored in the dictionary. |
String |
getLanguage()
Returns the language of this dictionary |
String |
getTypeName()
Returns the type name which should use to create annotations |
DictionaryMatch |
matchEntry(int pos,
org.apache.uima.cas.text.AnnotationFS[] annotFSs,
FeaturePathInfo featPathInfo)
Checks if at the current position in the token array a match in the dictionary is found. |
void |
printDictionary(Writer out)
print the dictionary content either to an Writer object or if not output is specified to the command line. |
void |
setDictionaryLanguage(String language)
set the dictionary language |
void |
setTypeName(String typeName)
set the dictionary type name |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HashMapDictionary(boolean caseNormalization)
| Method Detail |
|---|
public boolean contains(String word)
Dictionary
contains in interface Dictionaryword - word to look for
public boolean contains(String[] multiWord)
Dictionary
contains in interface DictionarymultiWord - multi word to look for
public String getTypeName()
Dictionary
getTypeName in interface Dictionarypublic String getLanguage()
Dictionary
getLanguage in interface Dictionary
public DictionaryMatch matchEntry(int pos,
org.apache.uima.cas.text.AnnotationFS[] annotFSs,
FeaturePathInfo featPathInfo)
Dictionary
matchEntry in interface Dictionarypos - current array positionannotFSs - input annotation FS arrayfeatPathInfo - featurePath information for the matching
public int getEntryCount()
Dictionary
getEntryCount in interface Dictionarypublic int addWord(String word)
word - word that should be added to the dictionary
public int addMultiWord(String[] multiWord)
multiWord - multi-word that should be added to the dictionary
public void printDictionary(Writer out)
throws IOException
out - Writer object to write the content to
IOExceptionpublic void setDictionaryLanguage(String language)
language - dictionary languagepublic void setTypeName(String typeName)
typeName - dictionary type name
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||