Package opennlp.tools.namefind
Class RegexNameFinder
java.lang.Object
opennlp.tools.namefind.RegexNameFinder
- All Implemented Interfaces:
TokenNameFinder
Name finder based on a series of regular expressions.
-
Constructor Summary
ConstructorsConstructorDescriptionRegexNameFinder(Map<String, Pattern[]> regexMap) RegexNameFinder(Pattern[] patterns) Deprecated.RegexNameFinder(Pattern[] patterns, String type) -
Method Summary
Modifier and TypeMethodDescriptionvoidForgets all adaptive data which was collected during previous calls to one of the find methods.Span[]NEW.Span[]Generates name tags for the given sequence, typically a sentence, returning token spans for any identified names.Pattern[]getsType()voidsetmPatterns(Pattern[] mPatterns) void
-
Constructor Details
-
RegexNameFinder
-
RegexNameFinder
-
RegexNameFinder
Deprecated.use constructorRegexNameFinder(Pattern[], String)for single types, and/or constructorRegexNameFinder(Map)
-
-
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:
tokens- an array of the tokens or words of the sequence, typically a sentence.- Returns:
- an array of spans for each of the names identified.
-
find
NEW. This method removes the need for tokenization, but returns the Span with character indices, rather than word.- Parameters:
text-- Returns:
-
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
-
getmPatterns
-
setmPatterns
-
getsType
-
setsType
-