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

public class PlainTextNaiveBayesModelWriter extends NaiveBayesModelWriter
A `NaiveBayesModelWriter` that writes models in a plain text format.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, BufferedWriter bw)`
  Instantiates `PlainTextNaiveBayesModelWriter` via an `naive bayes model` and a `BufferedWriter`.
  `PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, File f)`
  Instantiates `PlainTextNaiveBayesModelWriter` via an `naive bayes model` and a `File`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `writeDouble(double d)`
  `void`
  `writeInt(int i)`
  `void`
  `writeUTF(String s)`

  ### Methods inherited from class opennlp.tools.ml.naivebayes.NaiveBayesModelWriter

  `persist`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PlainTextNaiveBayesModelWriter

    public PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, File f) throws IOException
    Instantiates `PlainTextNaiveBayesModelWriter` via an `naive bayes model` and a `File`. Prepares writing of a `model` to 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 model` which is to be persisted.
      `f` - The `File` in which the model is to be persisted.
    Throws:
      `IOException` - Thrown if IO errors occurred.
    See Also:
      - `NaiveBayesModel`

  - ### PlainTextNaiveBayesModelWriter

    public PlainTextNaiveBayesModelWriter(opennlp.tools.ml.model.AbstractModel model, BufferedWriter bw)
    Instantiates `PlainTextNaiveBayesModelWriter` via an `naive bayes model` and a `BufferedWriter`. Prepares writing a `model` to 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 model` which is to be persisted.
      `bw` - The `BufferedWriter` which is used to persist the `model`. The `bw` must be opened.

- ## Method Details

  - ### writeUTF

    public void writeUTF(String s) throws IOException
    Specified by:
      `writeUTF` in class `opennlp.tools.ml.model.AbstractModelWriter`
    Throws:
      `IOException`

  - ### writeInt

    public void writeInt(int i) throws IOException
    Specified by:
      `writeInt` in class `opennlp.tools.ml.model.AbstractModelWriter`
    Throws:
      `IOException`

  - ### writeDouble

    public void writeDouble(double d) throws IOException
    Specified by:
      `writeDouble` in class `opennlp.tools.ml.model.AbstractModelWriter`
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in class `opennlp.tools.ml.model.AbstractModelWriter`
    Throws:
      `IOException`