Package opennlp.tools.ml.maxent.io
Class QNModelReader
java.lang.Object
opennlp.tools.ml.model.AbstractModelReader
opennlp.tools.ml.maxent.io.GISModelReader
opennlp.tools.ml.maxent.io.QNModelReader
- Direct Known Subclasses:
BinaryQNModelReader
The base class for readers of
QN models
.- See Also:
-
Constructor Summary
ConstructorDescriptionQNModelReader
(File file) Initializes aQNModelReader
via aFile
.QNModelReader
(DataReader dataReader) Initializes aQNModelReader
via aDataReader
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the model type via the the underlyingDataReader
.Retrieves a model from disk.Methods inherited from class opennlp.tools.ml.model.AbstractModelReader
getModel, readDouble, readInt, readUTF
-
Constructor Details
-
QNModelReader
Initializes aQNModelReader
via aDataReader
.- Parameters:
dataReader
- TheDataReader
that references the model to be read.
-
QNModelReader
Initializes aQNModelReader
via aFile
.- Parameters:
file
- TheFile
that references the model to be read.- Throws:
IOException
- Thrown if IO errors occurred.
-
-
Method Details
-
checkModelType
Description copied from class:AbstractModelReader
Checks the model type via the the underlyingDataReader
.- Overrides:
checkModelType
in classGISModelReader
- Throws:
IOException
- Thrown if IO errors occurred checking the model type.
-
constructModel
Retrieves a model from disk.If you are creating a reader for a format which won't work with this (perhaps a database or xml file), override this method and ignore the other methods provided in this abstract class.
- Overrides:
constructModel
in classGISModelReader
- Returns:
- The
QNModel
stored in the format and location specified to thisQNModelReader
(usually via its constructor). - Throws:
IOException
- Thrown if IO errors occurred during (re-)construction.
-