Package opennlp.tools.ml.model
Class AbstractModelWriter
java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
- Direct Known Subclasses:
AbstractMLModelWriter,GenericModelWriter
An abstract, basic implementation of a model writer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose()Closes the underlyingDataOutputStream.abstract voidpersist()Serializes themodelusing thewriteUTF(String),writeDouble(double), orwriteInt(int)} methods implemented by extending classes.abstract voidwriteDouble(double d) Writes a singledoubleto the underlyingDataOutputStream.abstract voidwriteInt(int i) Writes a singleintto the underlyingDataOutputStream.abstract voidWrites aStringto the underlyingDataOutputStream.
-
Constructor Details
-
AbstractModelWriter
public AbstractModelWriter()
-
-
Method Details
-
writeUTF
Writes aStringto the underlyingDataOutputStream.- Parameters:
s- TheUTF encodedcharacters.- Throws:
IOException- Thrown if IO errors occurred.
-
writeInt
Writes a singleintto the underlyingDataOutputStream.- Parameters:
i- Theintvalue.- Throws:
IOException- Thrown if IO errors occurred.
-
writeDouble
Writes a singledoubleto the underlyingDataOutputStream.- Parameters:
d- Thedoublevalue.- Throws:
IOException- Thrown if IO errors occurred.
-
close
Closes the underlyingDataOutputStream.- Throws:
IOException- Thrown if IO errors occurred.
-
persist
Serializes themodelusing thewriteUTF(String),writeDouble(double), orwriteInt(int)} methods implemented by extending classes.- Throws:
IOException- Thrown if IO errors occurred.
-