Package opennlp.tools.ml.model
Klasse AbstractModelReader
java.lang.Object
opennlp.tools.ml.model.AbstractModelReader
- Bekannte direkte Unterklassen:
GenericModelReader
,GISModelReader
,NaiveBayesModelReader
,PerceptronModelReader
An abstract, basic implementation of a model reader.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungInitializes aAbstractModelReader
via aFile
.AbstractModelReader
(DataReader dataReader) Initializes aAbstractModelReader
via aDataReader
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungabstract void
Checks the model type via the the underlyingDataReader
.abstract AbstractModel
Constructs amodel
.getModel()
double
Implement as needed for the format the model is stored in.int
readInt()
Implement as needed for the format the model is stored in.readUTF()
Implement as needed for the format the model is stored in.
-
Konstruktordetails
-
AbstractModelReader
Initializes aAbstractModelReader
via aFile
.- Parameter:
f
- TheFile
that references the model to be read.- Löst aus:
IOException
- Thrown if IO errors occurred.
-
AbstractModelReader
Initializes aAbstractModelReader
via aDataReader
.- Parameter:
dataReader
- TheDataReader
that references the model to be read.
-
-
Methodendetails
-
readInt
Implement as needed for the format the model is stored in.- Gibt zurück:
- Reads in an
int
value from the underlyingDataReader
. - Löst aus:
IOException
-
readDouble
Implement as needed for the format the model is stored in.- Gibt zurück:
- Reads in a
double
value from the underlyingDataReader
. - Löst aus:
IOException
-
readUTF
Implement as needed for the format the model is stored in.- Gibt zurück:
- Reads in an
UTF-encoded String
value from the underlyingDataReader
. - Löst aus:
IOException
-
getModel
- Gibt zurück:
- Retrieves the read
AbstractModel
instance. - Löst aus:
IOException
- Thrown if IO errors occurred constructing the model.
-
checkModelType
Checks the model type via the the underlyingDataReader
.- Löst aus:
IOException
- Thrown if IO errors occurred checking the model type.
-
constructModel
Constructs amodel
.- Gibt zurück:
- A
AbstractModel
reconstructed from a model's (read) attributes. - Löst aus:
IOException
- Thrown if IO errors occurred during (re-)construction.
-