Package opennlp.tools.namefind
Klasse NameSample
java.lang.Object
opennlp.tools.namefind.NameSample
- Alle implementierten Schnittstellen:
Serializable,Sample
Encapsulates names for a single unit of text.
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final StringThe default type value when there is no type in training data. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungNameSample(String[] sentence, Span[] names, boolean clearAdaptiveData) Initializes aNameSampleinstance with given parameters.NameSample(String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) Initializes aNameSampleinstance with given parameters.NameSample(String id, String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) Initializes aNameSampleinstance with given parameters. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanString[][]getId()Span[]getNames()String[]inthashCode()booleanstatic NameSampleParses given input into aNameSample.static NameSampleParses given input into aNameSample.toString()
-
Felddetails
-
DEFAULT_TYPE
The default type value when there is no type in training data.- Siehe auch:
-
-
Konstruktordetails
-
NameSample
public NameSample(String id, String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) Initializes aNameSampleinstance with given parameters.- Parameter:
id- The identifier to use.sentence- The tokens representing a training sentence. Must not benull.names- Thenamesto use.additionalContext- Additional context in a 2-dimensional array.clearAdaptiveData- Iftruethe adaptive data of the feature generators is cleared.- Löst aus:
RuntimeException- Thrown if name spans are overlapping.
-
NameSample
public NameSample(String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) Initializes aNameSampleinstance with given parameters.- Parameter:
sentence- The tokens representing a sentence. Must not benull.names- Thenamesto use.additionalContext- Additional context in a 2-dimensional array.clearAdaptiveData- Iftruethe adaptive data of the feature generators is cleared.- Löst aus:
RuntimeException- Thrown if name spans are overlapping.
-
NameSample
Initializes aNameSampleinstance with given parameters.- Parameter:
sentence- The tokens representing a sentence. Must not benull.names- Thenamesto use.clearAdaptiveData- Iftruethe adaptive data of the feature generators is cleared.- Löst aus:
RuntimeException- Thrown if name spans are overlapping.
-
-
Methodendetails
-
getId
- Gibt zurück:
- Retrieves the current identifier. May be
null.
-
getSentence
- Gibt zurück:
- Retrieves the sentence in tokenized form.
-
getNames
- Gibt zurück:
- Retrieves the
names.
-
getAdditionalContext
- Gibt zurück:
- Retrieves additional context. May be
null.
-
isClearAdaptiveDataSet
public boolean isClearAdaptiveDataSet()- Gibt zurück:
trueif the adaptive data of the feature generators are cleared,falseotherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-
parse
Parses given input into aNameSample.- Parameter:
taggedTokens- The input data to parse.clearAdaptiveData-trueif the adaptive data of the feature generators should be cleared,falseotherwise.- Gibt zurück:
- A
NameSampleinstance resulting from the parsing. - Löst aus:
IOException- Thrown if IO errors occurred during parsing.
-
parse
public static NameSample parse(String taggedTokens, String defaultType, boolean clearAdaptiveData) throws IOException Parses given input into aNameSample.- Parameter:
taggedTokens- The input data to parse.defaultType- The type to set by default.clearAdaptiveData-trueif the adaptive data of the feature generators should be cleared,falseotherwise.- Gibt zurück:
- A
NameSampleinstance resulting from the parsing. - Löst aus:
IOException- Thrown if IO errors occurred during parsing.
-