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`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GenericModelReader​(File f)` | Initializes a `GenericModelReader` via a `File`.
    `GenericModelReader​(DataReader dataReader)` | Initializes a `GenericModelReader` via a `DataReader`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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 Detail

    - #### 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​(DataReader dataReader)

      Initializes a `GenericModelReader` via a `DataReader`.
      Parameters:
        `dataReader` - The `DataReader` that references the model to be read.

  - ### Method Detail

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