Klasse SentenceDetectorFactory

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

public class SentenceDetectorFactory extends BaseToolFactory
The factory that provides SentenceDetector default implementations and resources
  • Konstruktordetails

    • 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.
      Parameter:
      languageCode - The ISO language code to be used for this factory.
      useTokenEnd - true if TOKEN_END_PROPERTY shall be used, false otherwise.
      abbreviationDictionary - The Dictionary which holds abbreviations.
      eosCharacters - The characters to be used to detect sentence endings.
  • Methodendetails

    • validateArtifactMap

      public void validateArtifactMap() throws InvalidFormatException
      Beschreibung aus Klasse kopiert: BaseToolFactory
      Validates the parsed artifacts.

      Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.

      Angegeben von:
      validateArtifactMap in Klasse BaseToolFactory
      Löst aus:
      InvalidFormatException - Thrown if validation found invalid states.
    • createArtifactMap

      public Map<String,Object> createArtifactMap()
      Beschreibung aus Klasse kopiert: BaseToolFactory
      A model's implementation should call this constructor that creates a model programmatically.

      The base implementation will return a HashMap that should be populated by subclasses.

      Setzt außer Kraft:
      createArtifactMap in Klasse BaseToolFactory
      Gibt zurück:
      Retrieves a Map with pairs of keys and objects.
    • createManifestEntries

      public Map<String,String> createManifestEntries()
      Setzt außer Kraft:
      createManifestEntries in Klasse BaseToolFactory
      Gibt zurück:
      Retrieves the manifest entries to be added to the model manifest.
    • create

      public static SentenceDetectorFactory create(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbrDictionary, char[] eosChars) throws InvalidFormatException
      Instantiates a SentenceDetectorFactory via a given subclassName.
      Parameter:
      subclassName - The class name used for instantiation. If null, an instance of SentenceDetectorFactory will be returned per default. Otherwise, the ExtensionLoader mechanism is applied to load the requested subclassName.
      languageCode - The ISO language code to be used. Must not be null.
      useTokenEnd - true if TOKEN_END_PROPERTY shall be set, false otherwise.
      abbrDictionary - The Dictionary of abbreviations if available; may be null.
      eosChars - An array of characters representing end of sentence symbols / characters.
      Gibt zurück:
      A valid SentenceDetectorFactory instance.
      Löst aus:
      InvalidFormatException - Thrown if the ExtensionLoader mechanism failed to create the factory associated with subclassName.
    • getEOSCharacters

      public char[] getEOSCharacters()
    • isUseTokenEnd

      public boolean isUseTokenEnd()
    • getAbbreviationDictionary

      public Dictionary getAbbreviationDictionary()
      Gibt zurück:
      An abbreviation Dictionary or null if unset.
    • getLanguageCode

      public String getLanguageCode()
    • getEndOfSentenceScanner

      public EndOfSentenceScanner getEndOfSentenceScanner()
      Gibt zurück:
      An EndOfSentenceScanner instance, guaranteed to be not null.
    • getSDContextGenerator

      public SDContextGenerator getSDContextGenerator()
      Gibt zurück:
      A SDContextGenerator instance, guaranteed to be not null.