Package opennlp.tools.ml.naivebayes
Class NaiveBayesModelWriter
- java.lang.Object
-
- opennlp.tools.ml.model.AbstractModelWriter
-
- opennlp.tools.ml.naivebayes.NaiveBayesModelWriter
-
- Direct Known Subclasses:
BinaryNaiveBayesModelWriter
,PlainTextNaiveBayesModelWriter
public abstract class NaiveBayesModelWriter extends AbstractModelWriter
The base class forNaiveBayesModel
writers.It provides the
persist()
method which takes care of the structure of a stored document, and requires an extending class to define precisely how the data should be stored.- See Also:
NaiveBayesModel
,AbstractModelWriter
-
-
Constructor Summary
Constructors Constructor Description NaiveBayesModelWriter(AbstractModel model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
persist()
Writes theperceptron model
, using theAbstractModelWriter.writeUTF(String)
,AbstractModelWriter.writeDouble(double)
, orAbstractModelWriter.writeInt(int)
} methods implemented by extending classes.-
Methods inherited from class opennlp.tools.ml.model.AbstractModelWriter
close, writeDouble, writeInt, writeUTF
-
-
-
-
Constructor Detail
-
NaiveBayesModelWriter
public NaiveBayesModelWriter(AbstractModel model)
-
-
Method Detail
-
persist
public void persist() throws IOException
Writes theperceptron model
, using theAbstractModelWriter.writeUTF(String)
,AbstractModelWriter.writeDouble(double)
, orAbstractModelWriter.writeInt(int)
} methods implemented by extending classes.If you wish to create a
NaiveBayesModelWriter
which uses a different structure, it will be necessary to override the#persist()
method in addition to implementing thewriteX(..)
methods.- Specified by:
persist
in classAbstractModelWriter
- Throws:
IOException
- Thrown if IO errors occurred.
-
-