Package opennlp.tools.ml.model
Klasse RealValueFileEventStream
java.lang.Object
opennlp.tools.ml.model.FileEventStream
opennlp.tools.ml.model.RealValueFileEventStream
- Alle implementierten Schnittstellen:
AutoCloseable
,ObjectStream<Event>
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:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungRealValueFileEventStream
(File file) Instantiates aRealValueFileEventStream
via aFile
.RealValueFileEventStream
(Reader reader) Instantiates aRealValueFileEventStream
via aReader
.RealValueFileEventStream
(String fileName) Instantiates aRealValueFileEventStream
from the specified file name.RealValueFileEventStream
(String fileName, String encoding) Instantiates aRealValueFileEventStream
from the specified file name. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic float[]
parseContexts
(String[] contexts) Parses the specifiedcontexts
and re-populates context array with features and returns the values for these features.read()
Returns the nextEvent
object.Von Klasse geerbte Methoden opennlp.tools.ml.model.FileEventStream
close, reset, toLine
-
Konstruktordetails
-
RealValueFileEventStream
Instantiates aRealValueFileEventStream
from the specified file name.- Parameter:
fileName
- The name fo the file containing the events.- Löst aus:
IOException
- Thrown if the specified file can not be read.
-
RealValueFileEventStream
Instantiates aRealValueFileEventStream
from the specified file name.- Parameter:
fileName
- The name fo the file containing the events.encoding
- The name of thecharacter encoding
.- Löst aus:
IOException
- Thrown if the specified file can not be read.
-
RealValueFileEventStream
Instantiates aRealValueFileEventStream
via aFile
.- Parameter:
file
- TheFile
that holds events.- Löst aus:
IOException
- Thrown if the specified file can not be read.
-
RealValueFileEventStream
Instantiates aRealValueFileEventStream
via aReader
.- Parameter:
reader
- TheReader
that holds events.- Löst aus:
IOException
- Thrown if the specified file can not be read.
-
-
Methodendetails
-
parseContexts
Parses the specifiedcontexts
and re-populates context array with features and returns the values for these features. If all values are unspecified, thennull
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
Returns the nextEvent
object. Calling this method repeatedly until it returnsnull
will return each object from the underlying source exactly once.- Angegeben von:
read
in SchnittstelleObjectStream<Event>
- Setzt außer Kraft:
read
in KlasseFileEventStream
- 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.
-