Package opennlp.tools.formats.ad

# Class ADSentenceSampleStream

java.lang.Object
opennlp.tools.formats.ad.ADSentenceSampleStream

All Implemented Interfaces:
  `AutoCloseable`, `opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>`

@Internal public class ADSentenceSampleStream extends Object implements opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>
Note: Do not use this class, internal use only!

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ADSentenceSampleStream(opennlp.tools.util.InputStreamFactory in, String charsetName, boolean includeHeadlines)`
  Initializes a new `ADSentenceSampleStream`.
  `ADSentenceSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, boolean includeHeadlines)`
  Initializes a new `ADSentenceSampleStream` from a `opennlp.tools.util.ObjectStream<String>`, that could be a `PlainTextByLineStream` object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `opennlp.tools.sentdetect.SentenceSample`
  `read()`
  `void`
  `reset()`

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

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

- ## Constructor Details

  - ### ADSentenceSampleStream

    public ADSentenceSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, boolean includeHeadlines)
    Initializes a new `ADSentenceSampleStream` from a `opennlp.tools.util.ObjectStream<String>`, that could be a `PlainTextByLineStream` object.
    Parameters:
      `lineStream` - A stream of lines as `String`.
      `includeHeadlines` - If `true` will output the sentences marked as news headlines.

  - ### ADSentenceSampleStream

    public ADSentenceSampleStream(opennlp.tools.util.InputStreamFactory in, String charsetName, boolean includeHeadlines) throws IOException
    Initializes a new `ADSentenceSampleStream`.
    Parameters:
      `in` - The `InputStreamFactory` for the corpus.
      `charsetName` - The `charset` to use for reading of the corpus.
      `includeHeadlines` - If `true` will output the sentences marked as news headlines.
    Throws:
      `IOException` - Thrown if IO errors occurred.

- ## Method Details

  - ### read

    public opennlp.tools.sentdetect.SentenceSample read() throws IOException
    Specified by:
      `read` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>`
    Throws:
      `IOException`

  - ### reset

    public void reset() throws IOException, UnsupportedOperationException
    Specified by:
      `reset` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>`
    Throws:
      `IOException`
      `UnsupportedOperationException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.sentdetect.SentenceSample>`
    Throws:
      `IOException`