Package opennlp.tools.ml.model
Class RealValueFileEventStream
java.lang.Object
opennlp.tools.ml.model.FileEventStream
opennlp.tools.ml.model.RealValueFileEventStream
- All Implemented Interfaces:
AutoCloseable,ObjectStream<Event>
-
Constructor Summary
ConstructorsConstructorDescriptionRealValueFileEventStream(File file) RealValueFileEventStream(String fileName) RealValueFileEventStream(String fileName, String encoding) -
Method Summary
Modifier and TypeMethodDescriptionstatic float[]parseContexts(String[] contexts) Parses the specified contexts and re-populates context array with features and returns the values for these features.read()Returns the next object.Methods inherited from class opennlp.tools.ml.model.FileEventStream
close, reset, toLine
-
Constructor Details
-
RealValueFileEventStream
- Throws:
IOException
-
RealValueFileEventStream
- Throws:
IOException
-
RealValueFileEventStream
- Throws:
IOException
-
-
Method Details
-
parseContexts
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.- Parameters:
contexts- The contexts with real values specified.- Returns:
- The value for each context or null if all values are unspecified.
-
read
Description copied from interface:ObjectStreamReturns the next object. Calling this method repeatedly until it returns null will return each object from the underlying source exactly once.- Specified by:
readin interfaceObjectStream<Event>- Overrides:
readin classFileEventStream- Returns:
- the next object or null to signal that the stream is exhausted
- Throws:
IOException- if there is an error during reading
-