Klasse RealValueFileEventStream

java.lang.Object
opennlp.tools.ml.model.FileEventStream
opennlp.tools.ml.model.RealValueFileEventStream
Alle implementierten Schnittstellen:
AutoCloseable, ObjectStream<Event>

public class RealValueFileEventStream extends FileEventStream
Class for using a file of real-valued events as an event stream. The format of the file is one event per line with each line consisting of outcome followed by contexts (space delimited).
Siehe auch:
  • Konstruktordetails

  • Methodendetails

    • parseContexts

      public static float[] parseContexts(String[] contexts)
      Parses the specified contexts and re-populates context array with features and returns the values for these features. If all values are unspecified, then null is returned.
      Parameter:
      contexts - The contexts with real values specified.
      Gibt zurück:
      The value for each context or null if all values are unspecified.
      Löst aus:
      RuntimeException - Thrown if negative real values are detected in the input data.
    • read

      public Event read() throws IOException
      Returns the next Event object. Calling this method repeatedly until it returns null will return each object from the underlying source exactly once.
      Angegeben von:
      read in Schnittstelle ObjectStream<Event>
      Setzt außer Kraft:
      read in Klasse FileEventStream
      Gibt zurück:
      The next object or null to signal that the stream is exhausted.
      Löst aus:
      IOException - Thrown if there is an error during reading.
      RuntimeException - Thrown if negative real values are detected in the input data.