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 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 a SentimentSampleTypeFilter object.
      Parameters:
      types - the types to filter.
      samples - the sentiment samples to be used.
  • Method Details

    • read

      public opennlp.tools.sentiment.SentimentSample read() throws IOException
      Returns:
      Reads and returns the next SentimentSample whose sentiment matches the configured types, or null if the stream is exhausted.
      Throws:
      IOException