Package opennlp.tools.postag

# Class POSSampleEventStream

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

All Implemented Interfaces:
  `AutoCloseable`, `ObjectStream<Event>`

public class POSSampleEventStream extends AbstractEventStream<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(ObjectStream<POSSample> samples)`
  Initializes the current instance with given samples and a `DefaultPOSContextGenerator`.
  `POSSampleEventStream(ObjectStream<POSSample> samples, POSContextGenerator cg)`
  Initializes the current instance with the given samples and a `POSContextGenerator`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static List<Event>`
  `generateEvents(String[] sentence, String[] tags, Object[] additionalContext, POSContextGenerator cg)`
  `static List<Event>`
  `generateEvents(String[] sentence, String[] tags, 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(ObjectStream<POSSample> samples, 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(ObjectStream<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<Event> generateEvents(String[] sentence, String[] tags, Object[] additionalContext, POSContextGenerator cg)

  - ### generateEvents

    public static List<Event> generateEvents(String[] sentence, String[] tags, POSContextGenerator cg)