public class HashMapDictionary extends java.lang.Object implements Dictionary
| Constructor and Description |
|---|
HashMapDictionary(boolean caseNormalization)
Creates a new HashMapDictionary object with an initial capacity of 100
entries.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
public HashMapDictionary(boolean caseNormalization)
public boolean contains(java.lang.String word)
Dictionarycontains in interface Dictionaryword - word to look forpublic boolean contains(java.lang.String[] multiWord)
Dictionarycontains in interface DictionarymultiWord - multi word to look forpublic java.lang.String getTypeName()
DictionarygetTypeName in interface Dictionarypublic java.lang.String getLanguage()
DictionarygetLanguage in interface Dictionarypublic DictionaryMatch matchEntry(int pos, org.apache.uima.cas.text.AnnotationFS[] annotFSs, FeaturePathInfo featPathInfo)
DictionarymatchEntry in interface Dictionarypos - current array positionannotFSs - input annotation FS arrayfeatPathInfo - featurePath information for the matchingpublic int getEntryCount()
DictionarygetEntryCount in interface Dictionarypublic int addWord(java.lang.String word)
word - word that should be added to the dictionarypublic int addMultiWord(java.lang.String[] multiWord)
multiWord - multi-word that should be added to the dictionarypublic void printDictionary(java.io.Writer out)
throws java.io.IOException
out - Writer object to write the content tojava.io.IOExceptionpublic void setDictionaryLanguage(java.lang.String language)
language - dictionary languagepublic void setTypeName(java.lang.String typeName)
typeName - dictionary type nameCopyright © 2013. All Rights Reserved.