|
||||||||||
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(java.lang.String[] multiWord)
Adds a new multi-word to the dictionary |
int |
addWord(java.lang.String word)
Adds a new word to the dictionary. |
boolean |
contains(java.lang.String word)
Checks if the given word is available in the dictionary. |
boolean |
contains(java.lang.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. |
java.lang.String |
getLanguage()
Returns the language of this dictionary |
java.lang.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(java.io.Writer out)
print the dictionary content either to an Writer object or if not output is specified to the command line. |
void |
setDictionaryLanguage(java.lang.String language)
set the dictionary language |
void |
setTypeName(java.lang.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(java.lang.String word)
Dictionary
contains
in interface Dictionary
word
- word to look for
public boolean contains(java.lang.String[] multiWord)
Dictionary
contains
in interface Dictionary
multiWord
- multi word to look for
public java.lang.String getTypeName()
Dictionary
getTypeName
in interface Dictionary
public java.lang.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 Dictionary
pos
- current array positionannotFSs
- input annotation FS arrayfeatPathInfo
- featurePath information for the matching
public int getEntryCount()
Dictionary
getEntryCount
in interface Dictionary
public int addWord(java.lang.String word)
word
- word that should be added to the dictionary
public int addMultiWord(java.lang.String[] multiWord)
multiWord
- multi-word that should be added to the dictionary
public void printDictionary(java.io.Writer out) throws java.io.IOException
out
- Writer object to write the content to
java.io.IOException
public void setDictionaryLanguage(java.lang.String language)
language
- dictionary languagepublic void setTypeName(java.lang.String typeName)
typeName
- dictionary type name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |