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 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)