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)
Dictionary
contains
in interface Dictionary
word
- word to look forpublic boolean contains(java.lang.String[] multiWord)
Dictionary
contains
in interface Dictionary
multiWord
- multi word to look forpublic 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 matchingpublic int getEntryCount()
Dictionary
getEntryCount
in interface Dictionary
public 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.IOException
public void setDictionaryLanguage(java.lang.String language)
language
- dictionary languagepublic void setTypeName(java.lang.String typeName)
typeName
- dictionary type nameCopyright © 2013. All Rights Reserved.