Package opennlp.tools.postag
Class POSSample
java.lang.Object
opennlp.tools.postag.POSSample
- All Implemented Interfaces:
Serializable
,Sample
Represents an pos-tagged
sentence
.- See Also:
-
Constructor Details
-
POSSample
Initializes aPOSSample
instance.- Parameters:
sentence
- The sentence of tokens to be tagged.tags
- An array of pos tags for each token provided insentence
.
-
POSSample
Initializes aPOSSample
instance.- Parameters:
sentence
- The sentence to be tagged.tags
- AList
of pos tags for each token provided insentence
.
-
POSSample
Initializes aPOSSample
instance.- Parameters:
sentence
- The sentence to be tagged.tags
- AList
of pos tags for each token provided insentence
.additionalContext
- A 2D array which holds additional information for the context.
-
POSSample
Initializes aPOSSample
instance.- Parameters:
sentence
- The sentence to be tagged.tags
- An array of pos tags for each token provided insentence
.additionalContext
- A 2D array which holds additional information for the context.
-
-
Method Details
-
getSentence
- Returns:
- Retrieves the sentence as array.
-
getTags
- Returns:
- Retrieves the tags as array.
-
getAdditionalContext
- Returns:
- Retrieves additional information for the context.
-
toString
-
parse
Parses asentenceString
.- Parameters:
sentenceString
- The sentence to be parsed.- Returns:
- A valid
POSSample
result. - Throws:
InvalidFormatException
- Thrown if errors occurred during parsing.
-
hashCode
public int hashCode() -
equals
-