Package opennlp.tools.namefind
Class DictionaryNameFinder
java.lang.Object
opennlp.tools.namefind.DictionaryNameFinder
- All Implemented Interfaces:
TokenNameFinder
This is a dictionary based name finder, it scans text
for names inside a dictionary.
-
Constructor Summary
ConstructorsConstructorDescriptionDictionaryNameFinder(Dictionary dictionary) Initializes the current instance with the provided dictionary.DictionaryNameFinder(Dictionary dictionary, String type) Initialized the current instance with he provided dictionary and a type. -
Method Summary
Modifier and TypeMethodDescriptionvoidForgets all adaptive data which was collected during previous calls to one of the find methods.Span[]Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names.
-
Constructor Details
-
DictionaryNameFinder
Initialized the current instance with he provided dictionary and a type.- Parameters:
dictionary-type- the name type used for the produced spans
-
DictionaryNameFinder
Initializes the current instance with the provided dictionary.- Parameters:
dictionary-
-
-
Method Details
-
find
Description copied from interface:TokenNameFinderGenerates name tags for the given sequence, typically a sentence, returning token spans for any identified names.- Specified by:
findin interfaceTokenNameFinder- Parameters:
textTokenized- an array of the tokens or words of the sequence, typically a sentence.- Returns:
- an array of spans for each of the names identified.
-
clearAdaptiveData
public void clearAdaptiveData()Description copied from interface:TokenNameFinderForgets all adaptive data which was collected during previous calls to one of the find methods. This method is typical called at the end of a document.- Specified by:
clearAdaptiveDatain interfaceTokenNameFinder
-