Class BinaryQNModelWriter

java.lang.Object
opennlp.tools.ml.model.AbstractModelWriter
opennlp.tools.ml.AbstractMLModelWriter

public class BinaryQNModelWriter extends QNModelWriter
A QNModelWriter that writes models in a binary format.
See Also:
  • Constructor Details

    • BinaryQNModelWriter

      public BinaryQNModelWriter(opennlp.tools.ml.model.AbstractModel model, File f) throws IOException
      Instantiates BinaryQNModelWriter via an QN 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 QN 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:
    • BinaryQNModelWriter

      public BinaryQNModelWriter(opennlp.tools.ml.model.AbstractModel model, DataOutputStream dos)
      Instantiates BinaryQNModelWriter via an QN model and a DataOutputStream.
      Parameters:
      model - The QN model which is to be persisted.
      dos - The DataOutputStream which is used to persist the model. The dos must be opened.
      See Also:
  • 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