Package opennlp.tools.ml.perceptron
Class BinaryPerceptronModelWriter
java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
opennlp.tools.ml.perceptron.PerceptronModelWriter
opennlp.tools.ml.perceptron.BinaryPerceptronModelWriter
Model writer that saves models in binary format.
-
Constructor Summary
ConstructorsConstructorDescriptionBinaryPerceptronModelWriter(AbstractModel model, DataOutputStream dos) Constructor which takes a GISModel and a DataOutputStream and prepares itself to write the model to that stream.BinaryPerceptronModelWriter(AbstractModel model, File f) Constructor which takes a GISModel and a File and prepares itself to write the model to that file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidwriteDouble(double d) voidwriteInt(int i) voidMethods inherited from class opennlp.tools.ml.perceptron.PerceptronModelWriter
persist
-
Constructor Details
-
BinaryPerceptronModelWriter
Constructor which takes a GISModel and a File and prepares itself to write the model to that file. Detects whether the file is gzipped or not based on whether the suffix contains ".gz".- Parameters:
model- The GISModel which is to be persisted.f- The File in which the model is to be persisted.- Throws:
IOException
-
BinaryPerceptronModelWriter
Constructor which takes a GISModel and a DataOutputStream and prepares itself to write the model to that stream.- Parameters:
model- The GISModel which is to be persisted.dos- The stream which will be used to persist the model.
-
-
Method Details
-
writeUTF
- Specified by:
writeUTFin classAbstractModelWriter- Throws:
IOException
-
writeInt
- Specified by:
writeIntin classAbstractModelWriter- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein classAbstractModelWriter- Throws:
IOException
-
close
- Specified by:
closein classAbstractModelWriter- Throws:
IOException
-