Package opennlp.tools.ml.naivebayes
Class PlainTextNaiveBayesModelWriter
- java.lang.Object
 - 
- opennlp.tools.ml.model.AbstractModelWriter
 - 
- opennlp.tools.ml.naivebayes.NaiveBayesModelWriter
 - 
- opennlp.tools.ml.naivebayes.PlainTextNaiveBayesModelWriter
 
 
 
 
- 
public class PlainTextNaiveBayesModelWriter extends NaiveBayesModelWriter
Model writer that saves models in plain text format. 
- 
- 
Constructor Summary
Constructors Constructor Description PlainTextNaiveBayesModelWriter(AbstractModel model, BufferedWriter bw)Constructor which takes a NaiveBayesModel and a BufferedWriter and prepares itself to write the model to that writer.PlainTextNaiveBayesModelWriter(AbstractModel model, File f)Constructor which takes a NaiveBayesModel and a File and prepares itself to write the model to that file. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidwriteDouble(double d)voidwriteInt(int i)voidwriteUTF(String s)- 
Methods inherited from class opennlp.tools.ml.naivebayes.NaiveBayesModelWriter
persist 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
PlainTextNaiveBayesModelWriter
public PlainTextNaiveBayesModelWriter(AbstractModel model, File f) throws IOException
Constructor which takes a NaiveBayesModel 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 NaiveBayesModel which is to be persisted.f- The File in which the model is to be persisted.- Throws:
 IOException
 
- 
PlainTextNaiveBayesModelWriter
public PlainTextNaiveBayesModelWriter(AbstractModel model, BufferedWriter bw)
Constructor which takes a NaiveBayesModel and a BufferedWriter and prepares itself to write the model to that writer.- Parameters:
 model- The NaiveBayesModel which is to be persisted.bw- The BufferedWriter which will be used to persist the model.
 
 - 
 
- 
Method Detail
- 
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
 writeUTFin classAbstractModelWriter- Throws:
 IOException
 
- 
writeInt
public void writeInt(int i) throws IOException- Specified by:
 writeIntin classAbstractModelWriter- Throws:
 IOException
 
- 
writeDouble
public void writeDouble(double d) throws IOException- Specified by:
 writeDoublein classAbstractModelWriter- Throws:
 IOException
 
- 
close
public void close() throws IOException- Specified by:
 closein classAbstractModelWriter- Throws:
 IOException
 
 - 
 
 -