Package opennlp.tools.ml.model
Class GenericModelReader
java.lang.Object
opennlp.tools.ml.model.AbstractModelReader
opennlp.tools.ml.model.GenericModelReader
An generic
AbstractModelReader
implementation.- See Also:
-
Constructor Summary
ConstructorDescriptionInitializes aGenericModelReader
via aFile
.GenericModelReader
(DataReader dataReader) Initializes aGenericModelReader
via aDataReader
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the model type via the the underlyingDataReader
.Constructs amodel
.Methods inherited from class opennlp.tools.ml.model.AbstractModelReader
getModel, readDouble, readInt, readUTF
-
Constructor Details
-
GenericModelReader
Initializes aGenericModelReader
via aFile
.- Parameters:
f
- TheFile
that references the model to be read.- Throws:
IOException
- Thrown if IO errors occurred.
-
GenericModelReader
Initializes aGenericModelReader
via aDataReader
.- Parameters:
dataReader
- TheDataReader
that references the model to be read.
-
-
Method Details
-
checkModelType
Description copied from class:AbstractModelReader
Checks the model type via the the underlyingDataReader
.- Specified by:
checkModelType
in classAbstractModelReader
- Throws:
IOException
- Thrown if IO errors occurred checking the model type.
-
constructModel
Description copied from class:AbstractModelReader
Constructs amodel
.- Specified by:
constructModel
in classAbstractModelReader
- Returns:
- A
AbstractModel
reconstructed from a model's (read) attributes. - Throws:
IOException
- Thrown if IO errors occurred during (re-)construction.
-