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
ConstructorsConstructorDescriptionQNModelReader(File file) Initializes aQNModelReadervia aFile.QNModelReader(DataReader dataReader) Initializes aQNModelReadervia aDataReader. -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks 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 aQNModelReadervia aDataReader.- Parameters:
dataReader- TheDataReaderthat references the model to be read.
-
QNModelReader
Initializes aQNModelReadervia aFile.- Parameters:
file- TheFilethat references the model to be read.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Details
-
checkModelType
Description copied from class:AbstractModelReaderChecks the model type via the the underlyingDataReader.- Overrides:
checkModelTypein 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:
constructModelin classGISModelReader- Returns:
- The
QNModelstored in the format and location specified to thisQNModelReader(usually via its constructor). - Throws:
IOException- Thrown if IO errors occurred during (re-)construction.
-