Class RealBasicEventStream
java.lang.Object
opennlp.tools.ml.maxent.RealBasicEventStream
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>
public class RealBasicEventStream
extends Object
implements opennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>
Class for real-valued
events as an
event stream.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRealBasicEventStream(opennlp.tools.util.ObjectStream<String> ds) Instantiates aRealBasicEventStreamover a stream of event lines. -
Method Summary
-
Constructor Details
-
RealBasicEventStream
Instantiates aRealBasicEventStreamover a stream of event lines.- Parameters:
ds- TheObjectStreamof lines, one event per line. Must not benull.- Throws:
IllegalArgumentException- Thrown ifdsisnull.
-
-
Method Details
-
read
Each line is parsed by
RealValueFileEventStream.parseEvent(String). A line with only an outcome yields an event without contexts.- Specified by:
readin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>- Throws:
IOException- Thrown if there is an error during reading.opennlp.tools.util.InvalidFormatException- Thrown if a line is blank.IllegalArgumentException- Thrown if a value is negative, NaN or infinite.
-
reset
- Specified by:
resetin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>- Throws:
IOExceptionUnsupportedOperationException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceopennlp.tools.util.ObjectStream<opennlp.tools.ml.model.Event>- Throws:
IOException
-