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 aQNModelReader
via aFile
.QNModelReader(DataReader dataReader)
Initializes aQNModelReader
via aDataReader
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkModelType()
Checks the model type via the the underlyingDataReader
.QNModel
constructModel()
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 aQNModelReader
via aDataReader
.- Parameters:
dataReader
- TheDataReader
that references the model to be read.
-
QNModelReader
public QNModelReader(File file) throws IOException
Initializes aQNModelReader
via aFile
.- Parameters:
file
- TheFile
that references the model to be read.- Throws:
IOException
- Thrown if IO errors occurred.
-
-
Method Detail
-
checkModelType
public void checkModelType() throws IOException
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
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:
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.
-
-