Package opennlp.tools.sentiment

# 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:
  - `FilterObjectStream`
  - `SentimentSample`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SentimentSampleTypeFilter(String[] types, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples)`
  Constructor
  `SentimentSampleTypeFilter(Set<String> types, opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples)`
  Instantiates a `SentimentSampleTypeFilter` object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `opennlp.tools.sentiment.SentimentSample`
  `read()`

  ### Methods inherited from class opennlp.tools.util.FilterObjectStream

  `close, reset`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`