Package opennlp.tools.postag
Class WordTagSampleStream
- All Implemented Interfaces:
AutoCloseable,ObjectStream<POSSample>
A
stream filter which reads a sentence per line that contains
words and tags in word_tag format and outputs a POSSample objects.-
Constructor Summary
ConstructorsConstructorDescriptionWordTagSampleStream(ObjectStream<String> sentences) Initializes aPOSSampleinstance. -
Method Summary
Methods inherited from class opennlp.tools.util.FilterObjectStream
close, reset
-
Constructor Details
-
Method Details
-
read
Reads the next tokens and parses it into the nextPOSSampleobject.If an error occurs an empty
POSSampleobject is returned and a warning message is logged. Usually it does not matter if one or many sentences are ignored.- Returns:
- A valid
POSSampleornullif thestreamis exhausted. - Throws:
IOException- Thrown if IO errors occurred during read.
-