MascPOSSampleStream (Apache OpenNLP :: Core :: Formats 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.formats.masc, class: MascPOSSampleStream

Package opennlp.tools.formats.masc

# Class MascPOSSampleStream

java.lang.Object
opennlp.tools.util.FilterObjectStream<MascDocument,opennlp.tools.postag.POSSample>
opennlp.tools.formats.masc.MascPOSSampleStream

All Implemented Interfaces:
  `AutoCloseable`, `opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample>`

public class MascPOSSampleStream extends opennlp.tools.util.FilterObjectStream<MascDocument,opennlp.tools.postag.POSSample>

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MascPOSSampleStream(opennlp.tools.util.ObjectStream<MascDocument> samples)`
  Initializes `MascPOSSampleStream` from a stream of `documents`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `opennlp.tools.postag.POSSample`
  `read()`
  Reads the next sample.
  `void`
  `reset()`

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

  `close`

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

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

- ## Constructor Details

  - ### MascPOSSampleStream

    public MascPOSSampleStream(opennlp.tools.util.ObjectStream<MascDocument> samples) throws IOException
    Initializes `MascPOSSampleStream` from a stream of `documents`.
    Parameters:
      `samples` - A `opennlp.tools.util.ObjectStream<MascDocument>` of samples.
    Throws:
      `IOException` - Thrown if none of the documents has POS tags.

- ## Method Details

  - ### read

    public opennlp.tools.postag.POSSample read() throws IOException
    Reads the next sample.
    Returns:
      One `sentence together with its POS tags`.
    Throws:
      `IOException` - Thrown if the sample cannot be extracted.

  - ### reset

    public void reset() throws IOException, UnsupportedOperationException
    Specified by:
      `reset` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample>`
    Overrides:
      `reset` in class `opennlp.tools.util.FilterObjectStream<MascDocument,opennlp.tools.postag.POSSample>`
    Throws:
      `IOException`
      `UnsupportedOperationException`