Package opennlp.tools.parser

# Class ParserModel

java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.parser.ParserModel

All Implemented Interfaces:
  `Serializable`, `ArtifactProvider`

public class ParserModel extends BaseModel
This is the default `ParserModel` implementation.

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
  `ParserModel(File modelFile)`
  Initializes a `ParserModel` instance via a valid `File`.
  `ParserModel(InputStream in)`
  Initializes a `ParserModel` instance via a valid `InputStream`.
  `ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType)`
  Initializes a `ParserModel` instance via given parameters.
  `ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType, Map<String,String> manifestInfoEntries)`
  Initializes a `ParserModel` instance via given parameters.
  `ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType type, Map<String,String> manifestInfoEntries)`
  Initializes a `ParserModel` instance via given parameters.
  `ParserModel(URL modelURL)`
  Initializes a `ParserModel` instance via a valid `URL`.
  `ParserModel(Path modelPath)`
  Initializes a `ParserModel` instance via a valid `Path`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `MaxentModel`
  `getAttachModel()`
  `MaxentModel`
  `getBuildModel()`
  `MaxentModel`
  `getCheckModel()`
  `HeadRules`
  `getHeadRules()`
  `ChunkerModel`
  `getParserChunkerModel()`
  `POSModel`
  `getParserTaggerModel()`
  `ParserType`
  `getParserType()`
  `int`
  `hashCode()`
  `ParserModel`
  `updateBuildModel(MaxentModel buildModel)`
  Instantiates a new `ParserModel` instance from the existing configuration with the specified `buildModel` for exchange.
  `ParserModel`
  `updateCheckModel(MaxentModel checkModel)`
  Instantiates a new `ParserModel` instance from the existing configuration with the specified `checkModel` for exchange.
  `ParserModel`
  `updateChunkerModel(ChunkerModel chunkModel)`
  Instantiates a new `ParserModel` instance from the existing configuration with the specified `chunkModel` for exchange.
  `ParserModel`
  `updateTaggerModel(POSModel taggerModel)`
  Instantiates a new `ParserModel` instance from the existing configuration with the specified `taggerModel` for exchange.

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

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

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

  `getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ParserModel

    public ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType, Map<String,String> manifestInfoEntries)
    Initializes a `ParserModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `buildModel` - A valid `MaxentModel` used to build.
      `checkModel` - A valid `MaxentModel` used to check.
      `attachModel` - A valid `MaxentModel` used to attach.
      `parserTagger` - A valid `POSModel` to parse.
      `chunkerTagger` - A valid `ChunkerModel` to chunk.
      `headRules` - The `HeadRules` to to use for parsing.
      `modelType` - The `ParserType` to use.
      `manifestInfoEntries` - Additional information kept in the manifest.

  - ### ParserModel

    public ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, MaxentModel attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType modelType)
    Initializes a `ParserModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `buildModel` - A valid `MaxentModel` used to build.
      `checkModel` - A valid `MaxentModel` used to check.
      `parserTagger` - A valid `POSModel` to parse.
      `chunkerTagger` - A valid `ChunkerModel` to chunk.
      `headRules` - The `HeadRules` to to use for parsing.
      `modelType` - The `ParserType` to use.

  - ### ParserModel

    public ParserModel(String languageCode, MaxentModel buildModel, MaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, HeadRules headRules, ParserType type, Map<String,String> manifestInfoEntries)
    Initializes a `ParserModel` instance via given parameters.
    Parameters:
      `languageCode` - An ISO conform language code.
      `buildModel` - A valid `MaxentModel` used to build.
      `checkModel` - A valid `MaxentModel` used to check.
      `parserTagger` - A valid `POSModel` to parse.
      `chunkerTagger` - A valid `ChunkerModel` to chunk.
      `headRules` - The `HeadRules` to to use for parsing.
      `type` - The `ParserType` to use.
      `manifestInfoEntries` - Additional information kept in the manifest.

  - ### ParserModel

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

  - ### ParserModel

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

  - ### ParserModel

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

  - ### ParserModel

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

- ## Method Details

  - ### getParserType

    public ParserType getParserType()
    Returns:
      Retrieves the `ParserType` as configured in the manifest.

  - ### getBuildModel

    public MaxentModel getBuildModel()
    Returns:
      Retrieves the `build model` as configured in the manifest.

  - ### getCheckModel

    public MaxentModel getCheckModel()
    Returns:
      Retrieves the `check model` as configured in the manifest.

  - ### getAttachModel

    public MaxentModel getAttachModel()
    Returns:
      Retrieves the `attach model` as configured in the manifest.

  - ### getParserTaggerModel

    public POSModel getParserTaggerModel()
    Returns:
      Retrieves the `POSModel` as configured in the manifest.

  - ### getParserChunkerModel

    public ChunkerModel getParserChunkerModel()
    Returns:
      Retrieves the `ChunkerModel` as configured in the manifest.

  - ### getHeadRules

    public HeadRules getHeadRules()
    Returns:
      Retrieves the `HeadRules` as configured in the manifest.

  - ### updateBuildModel

    public ParserModel updateBuildModel(MaxentModel buildModel)
    Instantiates a new `ParserModel` instance from the existing configuration with the specified `buildModel` for exchange.
    Parameters:
      `buildModel` - A valid `MaxentModel` used to build.
    Returns:
      A valid `ParserModel`.

  - ### updateCheckModel

    public ParserModel updateCheckModel(MaxentModel checkModel)
    Instantiates a new `ParserModel` instance from the existing configuration with the specified `checkModel` for exchange.
    Parameters:
      `checkModel` - A valid `MaxentModel` used to check.
    Returns:
      A valid `ParserModel`.

  - ### updateTaggerModel

    public ParserModel updateTaggerModel(POSModel taggerModel)
    Instantiates a new `ParserModel` instance from the existing configuration with the specified `taggerModel` for exchange.
    Parameters:
      `taggerModel` - A valid `POSModel` used to tag.
    Returns:
      A valid `ParserModel`.

  - ### updateChunkerModel

    public ParserModel updateChunkerModel(ChunkerModel chunkModel)
    Instantiates a new `ParserModel` instance from the existing configuration with the specified `chunkModel` for exchange.
    Parameters:
      `chunkModel` - A valid `ChunkerModel` used to tag.
    Returns:
      A valid `ParserModel`.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`