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
public class QNModelReader extends GISModelReader
The base class for readers ofQN models.- See Also:
QNModel,GISModelReader
-
-
Constructor Summary
Constructors Constructor Description QNModelReader(File file)Initializes aQNModelReadervia aFile.QNModelReader(DataReader dataReader)Initializes aQNModelReadervia aDataReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckModelType()Checks the model type via the the underlyingDataReader.QNModelconstructModel()Retrieves a model from disk.-
Methods inherited from class opennlp.tools.ml.model.AbstractModelReader
getModel, readDouble, readInt, readUTF
-
-
-
-
Constructor Detail
-
QNModelReader
public QNModelReader(DataReader dataReader)
Initializes aQNModelReadervia aDataReader.- Parameters:
dataReader- TheDataReaderthat references the model to be read.
-
QNModelReader
public QNModelReader(File file) throws IOException
Initializes aQNModelReadervia aFile.- Parameters:
file- TheFilethat references the model to be read.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Detail
-
checkModelType
public void checkModelType() throws IOExceptionDescription 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
public QNModel constructModel() throws IOException
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.
-
-