Package opennlp.tools.ml.naivebayes
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes the underlyingDataOutputStream.voidwriteDouble(double d) Writes a singledoubleto the underlyingDataOutputStream.voidwriteInt(int i) Writes a singleintto the underlyingDataOutputStream.voidWrites aStringto the underlyingDataOutputStream.Methods inherited from class opennlp.tools.ml.naivebayes.NaiveBayesModelWriterpersist
- 
Constructor Details- 
PlainTextNaiveBayesModelWriterInstantiatesPlainTextNaiveBayesModelWritervia 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- The- naive bayes modelwhich is to be persisted.
- f- The- Filein which the model is to be persisted.
- Throws:
- IOException- Thrown if IO errors occurred.
- See Also:
 
- 
PlainTextNaiveBayesModelWriterInstantiatesPlainTextNaiveBayesModelWritervia 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- The- naive bayes modelwhich is to be persisted.
- bw- The- BufferedWriterwhich is used to persist the- model. The- bwmust be opened.
 
 
- 
- 
Method Details- 
writeUTFDescription copied from class:AbstractModelWriterWrites aStringto the underlyingDataOutputStream.- Specified by:
- writeUTFin class- AbstractModelWriter
- Parameters:
- s- The- UTF encodedcharacters.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
writeIntDescription copied from class:AbstractModelWriterWrites a singleintto the underlyingDataOutputStream.- Specified by:
- writeIntin class- AbstractModelWriter
- Parameters:
- i- The- intvalue.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
writeDoubleDescription copied from class:AbstractModelWriterWrites a singledoubleto the underlyingDataOutputStream.- Specified by:
- writeDoublein class- AbstractModelWriter
- Parameters:
- d- The- doublevalue.
- Throws:
- IOException- Thrown if IO errors occurred.
 
- 
closeDescription copied from class:AbstractModelWriterCloses the underlyingDataOutputStream.- Specified by:
- closein class- AbstractModelWriter
- Throws:
- IOException- Thrown if IO errors occurred.
 
 
-