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
ConstructorsConstructorDescriptionInitializes aGenericModelReadervia aFile.GenericModelReader(DataReader dataReader) Initializes aGenericModelReadervia aDataReader. -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks 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 aGenericModelReadervia aFile.- Parameters:
f- TheFilethat references the model to be read.- Throws:
IOException- Thrown if IO errors occurred.
-
GenericModelReader
Initializes aGenericModelReadervia aDataReader.- Parameters:
dataReader- TheDataReaderthat references the model to be read.
-
-
Method Details
-
checkModelType
Description copied from class:AbstractModelReaderChecks the model type via the the underlyingDataReader.- Specified by:
checkModelTypein classAbstractModelReader- Throws:
IOException- Thrown if IO errors occurred checking the model type.
-
constructModel
Description copied from class:AbstractModelReaderConstructs amodel.- Specified by:
constructModelin classAbstractModelReader- Returns:
- A
AbstractModelreconstructed from a model's (read) attributes. - Throws:
IOException- Thrown if IO errors occurred during (re-)construction.
-