Class PlainTextNaiveBayesModelWriter
java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
opennlp.tools.ml.AbstractMLModelWriter
opennlp.tools.ml.naivebayes.NaiveBayesModelWriter
opennlp.tools.ml.naivebayes.PlainTextNaiveBayesModelWriter
A
NaiveBayesModelWriter that writes models in a plain text format.-
Constructor Summary
ConstructorsConstructorDescriptionPlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, BufferedWriter bw) PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, File f) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidwriteDouble(double d) voidwriteInt(int i) voidMethods inherited from class NaiveBayesModelWriter
persist
-
Constructor Details
-
PlainTextNaiveBayesModelWriter
public PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, File f) throws IOException InstantiatesPlainTextNaiveBayesModelWritervia annaive bayes modeland aFile. Prepares writing of amodelto the file. Based on whether the file's suffix contains.gz, it detects whether the file is gzipped or not.- Parameters:
model- Thenaive bayes modelwhich is to be persisted.f- TheFilein which the model is to be persisted.- Throws:
IOException- Thrown if IO errors occurred.- See Also:
-
PlainTextNaiveBayesModelWriter
public PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, BufferedWriter bw) InstantiatesPlainTextNaiveBayesModelWritervia annaive bayes modeland aBufferedWriter. Prepares writing amodelto the file. Based on whether the file's suffix contains.gz, it detects whether the file is gzipped or not.- Parameters:
model- Thenaive bayes modelwhich is to be persisted.bw- TheBufferedWriterwhich is used to persist themodel. Thebwmust be opened.
-
-
Method Details
-
writeUTF
- Specified by:
writeUTFin classopennlp.tools.ml.model.AbstractModelWriter- Throws:
IOException
-
writeInt
- Specified by:
writeIntin classopennlp.tools.ml.model.AbstractModelWriter- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein classopennlp.tools.ml.model.AbstractModelWriter- Throws:
IOException
-
close
- Specified by:
closein classopennlp.tools.ml.model.AbstractModelWriter- Throws:
IOException
-