Package opennlp.tools.sentiment
Class SentimentSampleTypeFilter
java.lang.Object
opennlp.tools.util.FilterObjectStream<SentimentSample,SentimentSample>
opennlp.tools.sentiment.SentimentSampleTypeFilter
- All Implemented Interfaces:
AutoCloseable,ObjectStream<SentimentSample>
Class for creating a type filter.
- See Also:
-
Field Summary
FieldsFields inherited from class opennlp.tools.util.FilterObjectStream
samples -
Constructor Summary
ConstructorsConstructorDescriptionSentimentSampleTypeFilter(String[] types, ObjectStream<SentimentSample> samples) ConstructorSentimentSampleTypeFilter(Set<String> types, ObjectStream<SentimentSample> samples) Instantiates aSentimentSampleTypeFilterobject. -
Method Summary
Methods inherited from class opennlp.tools.util.FilterObjectStream
close, reset
-
Field Details
-
types
-
-
Constructor Details
-
SentimentSampleTypeFilter
Constructor -
SentimentSampleTypeFilter
Instantiates aSentimentSampleTypeFilterobject.- Parameters:
types- the types to filter.samples- the sentiment samples to be used.
-
-
Method Details
-
read
Description copied from interface:ObjectStreamReturns the nextObjectStreamobject. Calling this method repeatedly until it returnsnullwill return each object from the underlying source exactly once.- Returns:
- Reads and returns the next
SentimentSamplewhose sentiment matches the configured types, ornullif the stream is exhausted. - Throws:
IOException- Thrown if there is an error during reading.
-