Package opennlp.tools.ml.model

# Class GenericModelReader

java.lang.Object
opennlp.tools.ml.model.AbstractModelReader
opennlp.tools.ml.model.GenericModelReader

public class GenericModelReader extends AbstractModelReader
An generic `AbstractModelReader` implementation.

See Also:
  - `AbstractModelReader`

- ## Field Summary

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

  `MAX_ENTRIES_PROPERTY`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkModelType()`
  Checks the model type via the the underlying `DataReader`.
  `AbstractModel`
  `constructModel()`
  Constructs a `model`.

  ### 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

  - ### GenericModelReader

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

  - ### GenericModelReader

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

- ## Method Details

  - ### checkModelType

    public void checkModelType() throws IOException
    Description copied from class: `AbstractModelReader`
    Checks the model type via the the underlying `DataReader`.
    Specified by:
      `checkModelType` in class `AbstractModelReader`
    Throws:
      `IOException` - Thrown if IO errors occurred checking the model type.

  - ### constructModel

    public AbstractModel constructModel() throws IOException
    Description copied from class: `AbstractModelReader`
    Constructs a `model`.
    Specified by:
      `constructModel` in class `AbstractModelReader`
    Returns:
      A `AbstractModel` reconstructed from a model's (read) attributes.
    Throws:
      `IOException` - Thrown if IO errors occurred during (re-)construction.