Package opennlp.tools.namefind
Klasse RegexNameFinder
java.lang.Object
opennlp.tools.namefind.RegexNameFinder
- Alle implementierten Schnittstellen:
TokenNameFinder
A
TokenNameFinder implementation based on a series of regular expressions.-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRegexNameFinder(Map<String, Pattern[]> regexMap) Initializes aRegexNameFinderinstance.RegexNameFinder(Pattern[] patterns, String type) Initializes aRegexNameFinderinstance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidForgets all adaptive data which was collected during previous calls to one of the find methods.Span[]Findsspanswith character indices, rather than word.Span[]Generates name tags for the given sequence, typically a sentence, returningtoken spansfor any identified names.Pattern[]voidsetMatchingPatterns(Pattern[] mPatterns) voidsetSpanType(String sType)
-
Konstruktordetails
-
RegexNameFinder
Initializes aRegexNameFinderinstance. -
RegexNameFinder
Initializes aRegexNameFinderinstance.- Parameter:
patterns- Thepatternsto use. Must not benulland not be empty.type- The type to use.- Löst aus:
IllegalArgumentException- Thrown ifpatternswerenullor empty.
-
-
Methodendetails
-
find
Beschreibung aus Schnittstelle kopiert:TokenNameFinderGenerates name tags for the given sequence, typically a sentence, returningtoken spansfor any identified names.- Angegeben von:
findin SchnittstelleTokenNameFinder- Parameter:
tokens- An array of the tokens or words of the sequence, typically a sentence.- Gibt zurück:
- An array of
spansfor each of the names identified.
-
find
Findsspanswith character indices, rather than word.- Parameter:
text- The text to use.- Gibt zurück:
- A
Spanrepresenting the annotations.
-
clearAdaptiveData
public void clearAdaptiveData()Beschreibung aus Schnittstelle kopiert:TokenNameFinderForgets all adaptive data which was collected during previous calls to one of the find methods.Note: This method should typically be called at the end of the processing of a document.
- Angegeben von:
clearAdaptiveDatain SchnittstelleTokenNameFinder
-
getMatchingPatterns
- Gibt zurück:
- Retrieves the
matching patternsused.
-
setMatchingPatterns
- Parameter:
mPatterns- Thematching patternsto be set.
-
getSpanType
- Gibt zurück:
- Retrieves the
Spantype used.
-
setSpanType
- Parameter:
sType- Sets a (different)Spantype.
-