Package opennlp.tools.sentdetect
Class SentenceDetectorFactory
java.lang.Object
opennlp.tools.util.BaseToolFactory
opennlp.tools.sentdetect.SentenceDetectorFactory
The factory that provides
SentenceDetector
default implementations and
resources-
Constructor Summary
ConstructorDescriptionCreates aSentenceDetectorFactory
that provides the default implementation of the resources.SentenceDetectorFactory
(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters) Creates aSentenceDetectorFactory
. -
Method Summary
Modifier and TypeMethodDescriptionstatic SentenceDetectorFactory
create
(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters) A model's implementation should call this constructor that creates a model programmatically.char[]
boolean
void
Validates the parsed artifacts.Methods inherited from class opennlp.tools.util.BaseToolFactory
create, create, createArtifactSerializersMap
-
Constructor Details
-
SentenceDetectorFactory
public SentenceDetectorFactory()Creates aSentenceDetectorFactory
that provides the default implementation of the resources. -
SentenceDetectorFactory
public SentenceDetectorFactory(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters) Creates aSentenceDetectorFactory
. Use this constructor to programmatically create a factory.- Parameters:
languageCode
- The ISO language code to be used for this factory.useTokenEnd
-true
ifTOKEN_END_PROPERTY
shall be used,false
otherwise.abbreviationDictionary
- TheDictionary
which holds abbreviations.eosCharacters
- The characters to be used to detect sentence endings.
-
-
Method Details
-
validateArtifactMap
Description copied from class:BaseToolFactory
Validates the parsed artifacts.Note: Subclasses should generally invoke
super.validateArtifactMap
at the beginning of this method.- Specified by:
validateArtifactMap
in classBaseToolFactory
- Throws:
InvalidFormatException
- Thrown if validation found invalid states.
-
createArtifactMap
Description copied from class: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.- Overrides:
createArtifactMap
in classBaseToolFactory
- Returns:
- Retrieves a
Map
with pairs of keys and objects.
-
createManifestEntries
- Overrides:
createManifestEntries
in classBaseToolFactory
- Returns:
- Retrieves the manifest entries to be 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
-
getLanguageCode
-
getEndOfSentenceScanner
-
getSDContextGenerator
-