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- 
POSSampleInitializes aPOSSampleinstance.- Parameters:
- sentence- The sentence of tokens to be tagged.
- tags- An array of pos tags for each token provided in- sentence.
 
- 
POSSampleInitializes aPOSSampleinstance.- Parameters:
- sentence- The sentence to be tagged.
- tags- A- Listof pos tags for each token provided in- sentence.
 
- 
POSSampleInitializes aPOSSampleinstance.- Parameters:
- sentence- The sentence to be tagged.
- tags- A- Listof pos tags for each token provided in- sentence.
- additionalContext- A 2D array which holds additional information for the context.
 
- 
POSSampleInitializes aPOSSampleinstance.- Parameters:
- sentence- The sentence to be tagged.
- tags- An array of pos tags for each token provided in- sentence.
- 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
- 
parseParses asentenceString.- Parameters:
- sentenceString- The sentence to be parsed.
- Returns:
- A valid POSSampleresult.
- Throws:
- InvalidFormatException- Thrown if errors occurred during parsing.
 
- 
hashCodepublic int hashCode()
- 
equals
 
-