public class HashMapDictionary extends 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(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
|
public HashMapDictionary(boolean caseNormalization)
public boolean contains(String word)
Dictionary
contains
in interface Dictionary
word
- word to look forpublic boolean contains(String[] multiWord)
Dictionary
contains
in interface Dictionary
multiWord
- multi word to look forpublic String getTypeName()
Dictionary
getTypeName
in interface Dictionary
public 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(String word)
word
- word that should be added to the dictionarypublic int addMultiWord(String[] multiWord)
multiWord
- multi-word that should be added to the dictionarypublic void printDictionary(Writer out) throws IOException
out
- Writer object to write the content toIOException
public void setDictionaryLanguage(String language)
language
- dictionary languagepublic void setTypeName(String typeName)
typeName
- dictionary type nameCopyright © 2006–2018 The Apache Software Foundation. All rights reserved.