Package opennlp.tools.sentdetect
Klasse SentenceDetectorFactory
java.lang.Object
opennlp.tools.util.BaseToolFactory
opennlp.tools.sentdetect.SentenceDetectorFactory
The factory that provides
SentenceDetector
default implementations and
resources-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates aSentenceDetectorFactory
that provides the default implementation of the resources.SentenceDetectorFactory
(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters) Creates aSentenceDetectorFactory
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic SentenceDetectorFactory
create
(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbrDictionary, char[] eosChars) Instantiates aSentenceDetectorFactory
via a givensubclassName
.A model's implementation should call this constructor that creates a model programmatically.char[]
boolean
void
Validates the parsed artifacts.Von Klasse geerbte Methoden opennlp.tools.util.BaseToolFactory
create, create, createArtifactSerializersMap
-
Konstruktordetails
-
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.- Parameter:
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.
-
-
Methodendetails
-
validateArtifactMap
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 KlasseBaseToolFactory
- Löst aus:
InvalidFormatException
- Thrown if validation found invalid states.
-
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 KlasseBaseToolFactory
- Gibt zurück:
- Retrieves a
Map
with pairs of keys and objects.
-
createManifestEntries
- Setzt außer Kraft:
createManifestEntries
in KlasseBaseToolFactory
- 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 aSentenceDetectorFactory
via a givensubclassName
.- Parameter:
subclassName
- The class name used for instantiation. Ifnull
, an instance ofSentenceDetectorFactory
will be returned per default. Otherwise, theExtensionLoader
mechanism is applied to load the requestedsubclassName
.languageCode
- The ISO language code to be used. Must not benull
.useTokenEnd
-true
ifTOKEN_END_PROPERTY
shall be set,false
otherwise.abbrDictionary
- TheDictionary
of abbreviations if available; may benull
.eosChars
- An array of characters representing end of sentence symbols / characters.- Gibt zurück:
- A valid
SentenceDetectorFactory
instance. - Löst aus:
InvalidFormatException
- Thrown if theExtensionLoader
mechanism failed to create the factory associated withsubclassName
.
-
getEOSCharacters
public char[] getEOSCharacters() -
isUseTokenEnd
public boolean isUseTokenEnd() -
getAbbreviationDictionary
- Gibt zurück:
- An abbreviation
Dictionary
ornull
if unset.
-
getLanguageCode
-
getEndOfSentenceScanner
- Gibt zurück:
- An
EndOfSentenceScanner
instance, guaranteed to be notnull
.
-
getSDContextGenerator
- Gibt zurück:
- A
SDContextGenerator
instance, guaranteed to be notnull
.
-