Class POSSampleSequenceStream

java.lang.Object
opennlp.tools.postag.POSSampleSequenceStream
All Implemented Interfaces:
AutoCloseable, opennlp.tools.ml.model.SequenceStream<opennlp.tools.postag.POSSample>, opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Sequence<opennlp.tools.postag.POSSample>>

public class POSSampleSequenceStream extends Object implements opennlp.tools.ml.model.SequenceStream<opennlp.tools.postag.POSSample>
A SequenceStream implementation encapsulating samples.
  • Constructor Details

    • POSSampleSequenceStream

      public POSSampleSequenceStream(opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample> psi)
      Creates a POSSampleSequenceStream with given samples using a DefaultPOSContextGenerator.
      Parameters:
      psi - The data stream of samples.
    • POSSampleSequenceStream

      public POSSampleSequenceStream(opennlp.tools.util.ObjectStream<opennlp.tools.postag.POSSample> psi, opennlp.tools.postag.POSContextGenerator pcg)
      Creates a POSSampleSequenceStream with given samples using a POSContextGenerator.
      Parameters:
      psi - The data stream of samples.
      pcg - A POSContextGenerator which shall be used.
  • Method Details

    • updateContext

      public opennlp.tools.ml.model.Event[] updateContext(opennlp.tools.ml.model.Sequence<opennlp.tools.postag.POSSample> pss, opennlp.tools.ml.model.MaxentModel model)
      Specified by:
      updateContext in interface opennlp.tools.ml.model.SequenceStream<opennlp.tools.postag.POSSample>
    • read

      public opennlp.tools.ml.model.Sequence<opennlp.tools.postag.POSSample> read() throws IOException
      Specified by:
      read in interface opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Sequence<opennlp.tools.postag.POSSample>>
      Throws:
      IOException
    • reset

      public void reset() throws IOException, UnsupportedOperationException
      Specified by:
      reset in interface opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Sequence<opennlp.tools.postag.POSSample>>
      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.ml.model.Sequence<opennlp.tools.postag.POSSample>>
      Throws:
      IOException