Package opennlp.tools.sentdetect

# Class SentenceModel

java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.sentdetect.SentenceModel

All Implemented Interfaces:
  `Serializable`, `ArtifactProvider`

public class SentenceModel extends BaseModel
The `SentenceModel` is the model used by a learnable `SentenceDetector`.

See Also:
  - `SentenceDetectorME`
  - 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
  `SentenceModel(File modelFile)`
  Initializes a `SentenceModel` instance via a valid `File`.
  `SentenceModel(InputStream in)`
  Initializes a `SentenceModel` instance via a valid `InputStream`.
  `SentenceModel(String languageCode, MaxentModel sentModel, Map<String,String> manifestInfoEntries, SentenceDetectorFactory sdFactory)`
  Initializes a `SentenceModel` instance via given parameters.
  `SentenceModel(URL modelURL)`
  Initializes a `SentenceModel` instance via a valid `URL`.
  `SentenceModel(Path modelPath)`
  Initializes a `SentenceModel` instance via a valid `Path`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Dictionary`
  `getAbbreviations()`
  `char[]`
  `getEosCharacters()`
  `SentenceDetectorFactory`
  `getFactory()`
  `MaxentModel`
  `getMaxentModel()`
  `boolean`
  `useTokenEnd()`

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

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

- ## Constructor Details

  - ### SentenceModel

    public SentenceModel(String languageCode, MaxentModel sentModel, Map<String,String> manifestInfoEntries, SentenceDetectorFactory sdFactory)
    Initializes a `SentenceModel` instance via given parameters.
    Parameters:
      `languageCode` - The ISO language code for this model. Must not be `null`.
      `sentModel` - A valid `MaxentModel`.
      `manifestInfoEntries` - Additional information kept in the manifest.
      `sdFactory` - The `SentenceDetectorFactory` for creating related objects.

  - ### SentenceModel

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

  - ### SentenceModel

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

  - ### SentenceModel

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

  - ### SentenceModel

    public SentenceModel(URL modelURL) throws IOException
    Initializes a `SentenceModel` 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

  - ### getFactory

    public SentenceDetectorFactory getFactory()

  - ### getMaxentModel

    public MaxentModel getMaxentModel()

  - ### getAbbreviations

    public Dictionary getAbbreviations()

  - ### useTokenEnd

    public boolean useTokenEnd()

  - ### getEosCharacters

    public char[] getEosCharacters()