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
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
Closes the underlyingDataOutputStream
.abstract void
persist()
Serializes themodel
using thewriteUTF(String)
,writeDouble(double)
, orwriteInt(int)
} methods implemented by extending classes.abstract void
writeDouble
(double d) Writes a singledouble
to the underlyingDataOutputStream
.abstract void
writeInt
(int i) Writes a singleint
to the underlyingDataOutputStream
.abstract void
Writes aString
to the underlyingDataOutputStream
.
-
Constructor Details
-
AbstractModelWriter
public AbstractModelWriter()
-
-
Method Details
-
writeUTF
Writes aString
to the underlyingDataOutputStream
.- Parameters:
s
- TheUTF encoded
characters.- Throws:
IOException
- Thrown if IO errors occurred.
-
writeInt
Writes a singleint
to the underlyingDataOutputStream
.- Parameters:
i
- Theint
value.- Throws:
IOException
- Thrown if IO errors occurred.
-
writeDouble
Writes a singledouble
to the underlyingDataOutputStream
.- Parameters:
d
- Thedouble
value.- Throws:
IOException
- Thrown if IO errors occurred.
-
close
Closes the underlyingDataOutputStream
.- Throws:
IOException
- Thrown if IO errors occurred.
-
persist
Serializes themodel
using thewriteUTF(String)
,writeDouble(double)
, orwriteInt(int)
} methods implemented by extending classes.- Throws:
IOException
- Thrown if IO errors occurred.
-