Package opennlp.tools.ml.model
Class GenericModelReader
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractModelReader
-
- opennlp.tools.ml.model.GenericModelReader
-
public class GenericModelReader extends AbstractModelReader
An genericAbstractModelReader
implementation.- See Also:
AbstractModelReader
-
-
Constructor Summary
Constructors Constructor Description GenericModelReader(File f)
Initializes aGenericModelReader
via aFile
.GenericModelReader(DataReader dataReader)
Initializes aGenericModelReader
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
.AbstractModel
constructModel()
Constructs amodel
.-
Methods inherited from class opennlp.tools.ml.model.AbstractModelReader
getModel, readDouble, readInt, readUTF
-
-
-
-
Constructor Detail
-
GenericModelReader
public GenericModelReader(File f) throws IOException
Initializes aGenericModelReader
via aFile
.- Parameters:
f
- TheFile
that references the model to be read.- Throws:
IOException
- Thrown if IO errors occurred.
-
GenericModelReader
public GenericModelReader(DataReader dataReader)
Initializes aGenericModelReader
via aDataReader
.- Parameters:
dataReader
- TheDataReader
that references the model to be read.
-
-
Method Detail
-
checkModelType
public void checkModelType() throws IOException
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
public AbstractModel constructModel() throws IOException
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.
-
-