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 aSentenceDetectorFactorythat provides the default implementation of the resources.SentenceDetectorFactory(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters) Creates aSentenceDetectorFactory. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic SentenceDetectorFactorycreate(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbrDictionary, char[] eosChars) Instantiates aSentenceDetectorFactoryvia a givensubclassName.A model's implementation should call this constructor that creates a model programmatically.char[]booleanvoidValidates the parsed artifacts.Von Klasse geerbte Methoden opennlp.tools.util.BaseToolFactory
create, create, createArtifactSerializersMap
-
Konstruktordetails
-
SentenceDetectorFactory
public SentenceDetectorFactory()Creates aSentenceDetectorFactorythat 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-trueifTOKEN_END_PROPERTYshall be used,falseotherwise.abbreviationDictionary- TheDictionarywhich holds abbreviations.eosCharacters- The characters to be used to detect sentence endings.
-
-
Methodendetails
-
validateArtifactMap
Beschreibung aus Klasse kopiert:BaseToolFactoryValidates the parsed artifacts.Note: Subclasses should generally invoke
super.validateArtifactMapat the beginning of this method.- Angegeben von:
validateArtifactMapin KlasseBaseToolFactory- Löst aus:
InvalidFormatException- Thrown if validation found invalid states.
-
createArtifactMap
Beschreibung aus Klasse kopiert:BaseToolFactoryA model's implementation should call this constructor that creates a model programmatically.The base implementation will return a
HashMapthat should be populated by subclasses.- Setzt außer Kraft:
createArtifactMapin KlasseBaseToolFactory- Gibt zurück:
- Retrieves a
Mapwith pairs of keys and objects.
-
createManifestEntries
- Setzt außer Kraft:
createManifestEntriesin 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 aSentenceDetectorFactoryvia a givensubclassName.- Parameter:
subclassName- The class name used for instantiation. Ifnull, an instance ofSentenceDetectorFactorywill be returned per default. Otherwise, theExtensionLoadermechanism is applied to load the requestedsubclassName.languageCode- The ISO language code to be used. Must not benull.useTokenEnd-trueifTOKEN_END_PROPERTYshall be set,falseotherwise.abbrDictionary- TheDictionaryof abbreviations if available; may benull.eosChars- An array of characters representing end of sentence symbols / characters.- Gibt zurück:
- A valid
SentenceDetectorFactoryinstance. - Löst aus:
InvalidFormatException- Thrown if theExtensionLoadermechanism failed to create the factory associated withsubclassName.
-
getEOSCharacters
public char[] getEOSCharacters() -
isUseTokenEnd
public boolean isUseTokenEnd() -
getAbbreviationDictionary
- Gibt zurück:
- An abbreviation
Dictionaryornullif unset.
-
getLanguageCode
-
getEndOfSentenceScanner
- Gibt zurück:
- An
EndOfSentenceScannerinstance, guaranteed to be notnull.
-
getSDContextGenerator
- Gibt zurück:
- A
SDContextGeneratorinstance, guaranteed to be notnull.
-