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 aRegexNameFinder
instance.RegexNameFinder
(Pattern[] patterns, String type) Initializes aRegexNameFinder
instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Forgets all adaptive data which was collected during previous calls to one of the find methods.Span[]
Findsspans
with character indices, rather than word.Span[]
Generates name tags for the given sequence, typically a sentence, returningtoken spans
for any identified names.Pattern[]
void
setMatchingPatterns
(Pattern[] mPatterns) void
setSpanType
(String sType)
-
Konstruktordetails
-
RegexNameFinder
Initializes aRegexNameFinder
instance. -
RegexNameFinder
Initializes aRegexNameFinder
instance.- Parameter:
patterns
- Thepatterns
to use. Must not benull
and not be empty.type
- The type to use.- Löst aus:
IllegalArgumentException
- Thrown ifpatterns
werenull
or empty.
-
-
Methodendetails
-
find
Beschreibung aus Schnittstelle kopiert:TokenNameFinder
Generates name tags for the given sequence, typically a sentence, returningtoken spans
for any identified names.- Angegeben von:
find
in SchnittstelleTokenNameFinder
- Parameter:
tokens
- An array of the tokens or words of the sequence, typically a sentence.- Gibt zurück:
- An array of
spans
for each of the names identified.
-
find
Findsspans
with character indices, rather than word.- Parameter:
text
- The text to use.- Gibt zurück:
- A
Span
representing the annotations.
-
clearAdaptiveData
public void clearAdaptiveData()Beschreibung aus Schnittstelle kopiert:TokenNameFinder
Forgets 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:
clearAdaptiveData
in SchnittstelleTokenNameFinder
-
getMatchingPatterns
- Gibt zurück:
- Retrieves the
matching patterns
used.
-
setMatchingPatterns
- Parameter:
mPatterns
- Thematching patterns
to be set.
-
getSpanType
- Gibt zurück:
- Retrieves the
Span
type used.
-
setSpanType
- Parameter:
sType
- Sets a (different)Span
type.
-