SentenceDetectorFactory (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.sentdetect

## Class SentenceDetectorFactory

- java.lang.Object
- - opennlp.tools.util.BaseToolFactory
  - - opennlp.tools.sentdetect.SentenceDetectorFactory

-     public class SentenceDetectorFactory
      extends BaseToolFactory

  The factory that provides SentenceDetecor default implementations and resources

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SentenceDetectorFactory()` Creates a `SentenceDetectorFactory` that provides the default implementation of the resources.
    `SentenceDetectorFactory(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters)` Creates a `SentenceDetectorFactory`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SentenceDetectorFactory` | `create(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters)`
    `Map<String,Object>` | `createArtifactMap()` Creates a `Map` with pairs of keys and objects.
    `Map<String,String>` | `createManifestEntries()` Creates the manifest entries that will be added to the model manifest
    `Dictionary` | `getAbbreviationDictionary()`
    `EndOfSentenceScanner` | `getEndOfSentenceScanner()`
    `char[]` | `getEOSCharacters()`
    `String` | `getLanguageCode()`
    `SDContextGenerator` | `getSDContextGenerator()`
    `boolean` | `isUseTokenEnd()`
    `void` | `validateArtifactMap()` Validates the parsed artifacts.

    - ### Methods inherited from class opennlp.tools.util.BaseToolFactory

      `create, create, createArtifactSerializersMap`

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

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

- - ### Constructor Detail

    - #### SentenceDetectorFactory

          public SentenceDetectorFactory()

      Creates a `SentenceDetectorFactory` that provides the default implementation of the resources.

    - #### SentenceDetectorFactory

          public SentenceDetectorFactory(String languageCode,
                                         boolean useTokenEnd,
                                         Dictionary abbreviationDictionary,
                                         char[] eosCharacters)

      Creates a `SentenceDetectorFactory`. Use this constructor to programmatically create a factory.
      Parameters:
        `languageCode` -
        `abbreviationDictionary` -
        `eosCharacters` -

  - ### Method Detail

    - #### validateArtifactMap

          public void validateArtifactMap()
                                   throws InvalidFormatException

      Description copied from class: `BaseToolFactory`
      Validates the parsed artifacts. If something is not valid subclasses should throw an `InvalidFormatException`. Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.
      Specified by:
        `validateArtifactMap` in class `BaseToolFactory`
      Throws:
        `InvalidFormatException`

    - #### createArtifactMap

          public Map<String,Object> createArtifactMap()

      Description copied from class: `BaseToolFactory`
      Creates a `Map` with pairs of keys and objects. The models implementation should call this constructor that creates a model programmatically.

      The base implementation will return a `HashMap` that should be populated by sub-classes.

      Overrides:
        `createArtifactMap` in class `BaseToolFactory`

    - #### createManifestEntries

          public Map<String,String> createManifestEntries()

      Description copied from class: `BaseToolFactory`
      Creates the manifest entries that will be added to the model manifest
      Overrides:
        `createManifestEntries` in class `BaseToolFactory`
      Returns:
        the manifest entries to added to the model manifest

    - #### create

          public static SentenceDetectorFactory create(String subclassName,
                                                       String languageCode,
                                                       boolean useTokenEnd,
                                                       Dictionary abbreviationDictionary,
                                                       char[] eosCharacters)
                                                throws InvalidFormatException

      Throws:
        `InvalidFormatException`

    - #### getEOSCharacters

          public char[] getEOSCharacters()

    - #### isUseTokenEnd

          public boolean isUseTokenEnd()

    - #### getAbbreviationDictionary

          public Dictionary getAbbreviationDictionary()

    - #### getLanguageCode

          public String getLanguageCode()

    - #### getEndOfSentenceScanner

          public EndOfSentenceScanner getEndOfSentenceScanner()

    - #### getSDContextGenerator

          public SDContextGenerator getSDContextGenerator()

Copyright © 2026 The Apache Software Foundation. All rights reserved.