Package opennlp.tools.ml.maxent.io

# Class QNModelReader

java.lang.Object
opennlp.tools.ml.model.AbstractModelReader
opennlp.tools.ml.maxent.io.GISModelReader
opennlp.tools.ml.maxent.io.QNModelReader

Direct Known Subclasses:
  `BinaryQNModelReader`

public class QNModelReader extends GISModelReader
The base class for readers of `QN models`.

See Also:
  - `QNModel`
  - `GISModelReader`

- ## Field Summary

  ### Fields inherited from class opennlp.tools.ml.model.AbstractModelReader

  `MAX_ENTRIES_PROPERTY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `QNModelReader(File file)`
  Initializes a `QNModelReader` via a `File`.
  `QNModelReader(opennlp.tools.ml.model.DataReader dataReader)`
  Initializes a `QNModelReader` via a `DataReader`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkModelType()`
  `QNModel`
  `constructModel()`
  Retrieves a model from disk.

  ### Methods inherited from class opennlp.tools.ml.model.AbstractModelReader

  `getModel, readDouble, readInt, readUTF`

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

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

- ## Constructor Details

  - ### QNModelReader

    public QNModelReader(opennlp.tools.ml.model.DataReader dataReader)
    Initializes a `QNModelReader` via a `DataReader`.
    Parameters:
      `dataReader` - The `DataReader` that references the model to be read.

  - ### QNModelReader

    public QNModelReader(File file) throws IOException
    Initializes a `QNModelReader` via a `File`.
    Parameters:
      `file` - The `File` that references the model to be read.
    Throws:
      `IOException` - Thrown if IO errors occurred.

- ## Method Details

  - ### checkModelType

    public void checkModelType() throws IOException
    Overrides:
      `checkModelType` in class `GISModelReader`
    Throws:
      `IOException`

  - ### constructModel

    public QNModel constructModel() throws IOException
    Retrieves a model from disk.

    If you are creating a reader for a format which won't work with this (perhaps a database or xml file), override this method and ignore the other methods provided in this abstract class.

    Overrides:
      `constructModel` in class `GISModelReader`
    Returns:
      The `QNModel` stored in the format and location specified to this `QNModelReader` (usually via its constructor).
    Throws:
      `IOException`