Class SentimentSampleTypeFilter
java.lang.Object
opennlp.tools.util.FilterObjectStream<opennlp.tools.sentiment.SentimentSample, opennlp.tools.sentiment.SentimentSample>
opennlp.tools.sentiment.SentimentSampleTypeFilter
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample>
public class SentimentSampleTypeFilter
extends FilterObjectStream<opennlp.tools.sentiment.SentimentSample, opennlp.tools.sentiment.SentimentSample>
Class for creating a type filter.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSentimentSampleTypeFilter(String[] types, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples) ConstructorSentimentSampleTypeFilter(Set<String> types, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples) Instantiates aSentimentSampleTypeFilterobject. -
Method Summary
Methods inherited from class FilterObjectStream
close, reset
-
Constructor Details
-
SentimentSampleTypeFilter
public SentimentSampleTypeFilter(String[] types, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples) Constructor -
SentimentSampleTypeFilter
public SentimentSampleTypeFilter(Set<String> types, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples) Instantiates aSentimentSampleTypeFilterobject.- Parameters:
types- the types to filter.samples- the sentiment samples to be used.
-
-
Method Details
-
read
- Returns:
- Reads and returns the next
SentimentSamplewhose sentiment matches the configured types, ornullif the stream is exhausted. - Throws:
IOException
-