Package opennlp.tools.doccat
Class DocumentSample
- java.lang.Object
-
- opennlp.tools.doccat.DocumentSample
-
- All Implemented Interfaces:
Serializable
,Sample
public class DocumentSample extends Object implements Sample
Class which holds a classified document and its category.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getCategory()
Map<String,Object>
getExtraInformation()
String[]
getText()
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
DocumentSample
public DocumentSample(String category, String[] text)
Initializes ainstance
.- Parameters:
category
- The category to be used. Must not benull
.text
- The plain text in a tokenized form. Must not benull
.
-
DocumentSample
public DocumentSample(String category, String[] text, Map<String,Object> extraInformation)
Initializes ainstance
.- Parameters:
category
- The category to be used.Must not benull
.text
- The plain text in a tokenized form. Must not benull
.extraInformation
- Additional information for context.
-
-