Package opennlp.tools.ml.model
Class PlainTextFileDataReader
- java.lang.Object
-
- opennlp.tools.ml.model.PlainTextFileDataReader
-
- All Implemented Interfaces:
DataReader
public class PlainTextFileDataReader extends Object implements DataReader
A genericDataReader
implementation for plain text files.- See Also:
DataReader
-
-
Constructor Summary
Constructors Constructor Description PlainTextFileDataReader(BufferedReader in)
Initializes aPlainTextFileDataReader
via aBufferedReader
.PlainTextFileDataReader(File f)
Initializes aPlainTextFileDataReader
via aFile
.PlainTextFileDataReader(InputStream in)
Initializes aPlainTextFileDataReader
via aInputStream
.
-
-
-
Constructor Detail
-
PlainTextFileDataReader
public PlainTextFileDataReader(File f) throws IOException
Initializes aPlainTextFileDataReader
via aFile
.- Parameters:
f
- TheFile
that references the model to be read.- Throws:
IOException
- Thrown if IO errors occurred.
-
PlainTextFileDataReader
public PlainTextFileDataReader(InputStream in)
Initializes aPlainTextFileDataReader
via aInputStream
.- Parameters:
in
- TheInputStream
that references the file to be read.
-
PlainTextFileDataReader
public PlainTextFileDataReader(BufferedReader in)
Initializes aPlainTextFileDataReader
via aBufferedReader
.- Parameters:
in
- TheBufferedReader
that references the file to be read.
-
-
Method Detail
-
readDouble
public double readDouble() throws IOException
- Specified by:
readDouble
in interfaceDataReader
- Returns:
- Reads and returns a
double
value. - Throws:
IOException
- Thrown if IO errors occurred during read operation.
-
readInt
public int readInt() throws IOException
- Specified by:
readInt
in interfaceDataReader
- Returns:
- Reads and returns an
int
value. - Throws:
IOException
- Thrown if IO errors occurred during read operation.
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTF
in interfaceDataReader
- Returns:
- Reads and returns
UTF-encoded characters
. - Throws:
IOException
- Thrown if IO errors occurred during read operation.
-
-