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 aAbstractModelReadervia aFile.AbstractModelReader(DataReader dataReader) Initializes aAbstractModelReadervia aDataReader. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungabstract voidChecks the model type via the the underlyingDataReader.abstract AbstractModelConstructs amodel.getModel()doubleImplement as needed for the format the model is stored in.intreadInt()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 aAbstractModelReadervia aFile.- Parameter:
f- TheFilethat references the model to be read.- Löst aus:
IOException- Thrown if IO errors occurred.
-
AbstractModelReader
Initializes aAbstractModelReadervia aDataReader.- Parameter:
dataReader- TheDataReaderthat 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
intvalue 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
doublevalue 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 Stringvalue from the underlyingDataReader. - Löst aus:
IOException
-
getModel
- Gibt zurück:
- Retrieves the read
AbstractModelinstance. - 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
AbstractModelreconstructed from a model's (read) attributes. - Löst aus:
IOException- Thrown if IO errors occurred during (re-)construction.
-