Class PlainTextNaiveBayesModelWriter
- Namespace
- NOpenNLP.Tools.Ml.Naivebayes
- Assembly
- NOpenNLP.Tools.dll
Model writer that saves models in plain text format.
public class PlainTextNaiveBayesModelWriter : NaiveBayesModelWriter, IDisposable
- Inheritance
-
PlainTextNaiveBayesModelWriter
- Implements
- Inherited Members
Constructors
PlainTextNaiveBayesModelWriter(AbstractModel, FileInfo)
Constructor which takes a NaiveBayesModel and a FileInfo 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".
public PlainTextNaiveBayesModelWriter(AbstractModel model, FileInfo f)
Parameters
modelAbstractModelThe NaiveBayesModel which is to be persisted.
fFileInfoThe file in which the model is to be persisted.
PlainTextNaiveBayesModelWriter(AbstractModel, TextWriter)
Constructor which takes a NaiveBayesModel and a TextWriter and prepares itself to write the model to that writer.
public PlainTextNaiveBayesModelWriter(AbstractModel model, TextWriter bw)
Parameters
modelAbstractModelThe NaiveBayesModel which is to be persisted.
bwTextWriterThe writer which will be used to persist the model.
Methods
CloseCore()
Performs the actual close. Called at most once.
protected override void CloseCore()
Exceptions
- IOException
if there is an error during writing
WriteDouble(double)
public override void WriteDouble(double d)
Parameters
ddouble
Exceptions
- IOException
if there is an error during writing
WriteInt32(int)
public override void WriteInt32(int i)
Parameters
iint
Exceptions
- IOException
if there is an error during writing
WriteUTF(string)
public override void WriteUTF(string s)
Parameters
sstring
Exceptions
- IOException
if there is an error during writing