Package opennlp.tools.doccat

## Class DoccatModel

- java.lang.Object
- - opennlp.tools.util.model.BaseModel
  - - opennlp.tools.doccat.DoccatModel

- All Implemented Interfaces:
    `Serializable`, `ArtifactProvider`

      public class DoccatModel
      extends BaseModel

  A model for document categorization
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class opennlp.tools.util.model.BaseModel

      `TRAINING_CUTOFF_PROPERTY, TRAINING_EVENTHASH_PROPERTY, TRAINING_ITERATIONS_PROPERTY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DoccatModel​(File modelFile)` | Initializes a `DoccatModel` instance via a valid `File`.
    `DoccatModel​(InputStream in)` | Initializes a `DoccatModel` instance via a valid `InputStream`.
    `DoccatModel​(String languageCode, MaxentModel doccatModel, Map<String,​String> manifestInfoEntries, DoccatFactory factory)` | Initializes a `DoccatModel` instance via given parameters.
    `DoccatModel​(URL modelURL)` | Initializes a `DoccatModel` instance via a valid `URL`.
    `DoccatModel​(Path modelPath)` | Initializes a `DoccatModel` instance via a valid `Path`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DoccatFactory` | `getFactory()` |
    `MaxentModel` | `getMaxentModel()` |

    - ### Methods inherited from class opennlp.tools.util.model.BaseModel

      `getArtifact, getLanguage, getManifestProperty, getVersion, isLoadedFromSerialized, serialize, serialize, serialize`

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

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

- - ### Constructor Detail

    - #### DoccatModel

          public DoccatModel​(String languageCode,
                             MaxentModel doccatModel,
                             Map<String,​String> manifestInfoEntries,
                             DoccatFactory factory)

      Initializes a `DoccatModel` instance via given parameters.
      Parameters:
        `languageCode` - An ISO conform language code.
        `doccatModel` - A valid `MaxentModel` to be used.
        `manifestInfoEntries` - Additional information kept in the manifest.
        `factory` - The `DoccatFactory` to be used.

    - #### DoccatModel

          public DoccatModel​(InputStream in)
                      throws IOException

      Initializes a `DoccatModel` instance via a valid `InputStream`.
      Parameters:
        `in` - The `InputStream` used for loading the model.
      Throws:
        `IOException` - Thrown if IO errors occurred during initialization.

    - #### DoccatModel

          public DoccatModel​(File modelFile)
                      throws IOException

      Initializes a `DoccatModel` instance via a valid `File`.
      Parameters:
        `modelFile` - The `File` used for loading the model.
      Throws:
        `IOException` - Thrown if IO errors occurred during initialization.

    - #### DoccatModel

          public DoccatModel​(Path modelPath)
                      throws IOException

      Initializes a `DoccatModel` instance via a valid `Path`.
      Parameters:
        `modelPath` - The `Path` used for loading the model.
      Throws:
        `IOException` - Thrown if IO errors occurred during initialization.

    - #### DoccatModel

          public DoccatModel​(URL modelURL)
                      throws IOException

      Initializes a `DoccatModel` instance via a valid `URL`.
      Parameters:
        `modelURL` - The `URL` used for loading the model.
      Throws:
        `IOException` - Thrown if IO errors occurred during initialization.

  - ### Method Detail

    - #### getFactory

          public DoccatFactory getFactory()

      Returns:
        Retrieves the active `DoccatFactory`.

    - #### getMaxentModel

          public MaxentModel getMaxentModel()

      Returns:
        Retrieves the active `MaxentModel`.