POSSampleEventStream (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.postag, class: POSSampleEventStream

Package opennlp.tools.postag

# Class POSSampleEventStream

java.lang.Object
opennlp.tools.util.AbstractEventStream<opennlp.tools.postag.POSSample>
opennlp.tools.postag.POSSampleEventStream

All Implemented Interfaces:
  `AutoCloseable`, `opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>`

public class POSSampleEventStream extends AbstractEventStream<opennlp.tools.postag.POSSample>
Reads the `samples` from an `Iterator` and converts those samples into `events` which can be used by the maxent library for training.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `POSSampleEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample> samples)`
  Initializes the current instance with given samples and a `DefaultPOSContextGenerator`.
  `POSSampleEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample> samples, opennlp.tools.postag.POSContextGenerator cg)`
  Initializes the current instance with the given samples and a `POSContextGenerator`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static List<opennlp.tools.ml.model.Event>`
  `generateEvents(String[] sentence, String[] tags, Object[] additionalContext, opennlp.tools.postag.POSContextGenerator cg)`
  `static List<opennlp.tools.ml.model.Event>`
  `generateEvents(String[] sentence, String[] tags, opennlp.tools.postag.POSContextGenerator cg)`

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

  `close, read, reset`

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

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

- ## Constructor Details

  - ### POSSampleEventStream

    public POSSampleEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample> samples, opennlp.tools.postag.POSContextGenerator cg)
    Initializes the current instance with the given samples and a `POSContextGenerator`.
    Parameters:
      `samples` - The data stream for this event stream.
      `cg` - A `POSContextGenerator` to process the event stream `samples`.

  - ### POSSampleEventStream

    public POSSampleEventStream(opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample> samples)
    Initializes the current instance with given samples and a `DefaultPOSContextGenerator`.
    Parameters:
      `samples` - The data stream for this event stream.

- ## Method Details

  - ### generateEvents

    public static List<opennlp.tools.ml.model.Event> generateEvents(String[] sentence, String[] tags, Object[] additionalContext, opennlp.tools.postag.POSContextGenerator cg)

  - ### generateEvents

    public static List<opennlp.tools.ml.model.Event> generateEvents(String[] sentence, String[] tags, opennlp.tools.postag.POSContextGenerator cg)