Package opennlp.tools.namefind
Class NameSample
java.lang.Object
opennlp.tools.namefind.NameSample
- All Implemented Interfaces:
Serializable
Class for holding names for a single unit of text.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe a default type value when there is no type in training data. -
Constructor Summary
ConstructorsConstructorDescriptionNameSample(String[] sentence, Span[] names, boolean clearAdaptiveData) NameSample(String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) Initializes the current instance.NameSample(String id, String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) -
Method Summary
Modifier and TypeMethodDescriptionbooleanString[][]getId()Span[]getNames()String[]inthashCode()booleanstatic NameSamplestatic NameSampletoString()
-
Field Details
-
DEFAULT_TYPE
The a default type value when there is no type in training data.- See Also:
-
-
Constructor Details
-
NameSample
-
NameSample
public NameSample(String[] sentence, Span[] names, String[][] additionalContext, boolean clearAdaptiveData) Initializes the current instance.- Parameters:
sentence- training sentencenames-additionalContext-clearAdaptiveData- if true the adaptive data of the feature generators is cleared
-
NameSample
-
-
Method Details
-
getId
-
getSentence
-
getNames
-
getAdditionalContext
-
isClearAdaptiveDataSet
public boolean isClearAdaptiveDataSet() -
hashCode
public int hashCode() -
equals
-
toString
-
parse
- Throws:
IOException
-
parse
public static NameSample parse(String taggedTokens, String defaultType, boolean isClearAdaptiveData) throws IOException - Throws:
IOException
-