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 SummaryConstructorsConstructorDescriptionCreates aSentenceDetectorFactorythat provides the default implementation of the resources.SentenceDetectorFactory(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters) Creates aSentenceDetectorFactory.
- 
Method SummaryModifier and TypeMethodDescriptionstatic 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.Methods inherited from class opennlp.tools.util.BaseToolFactorycreate, create, createArtifactSerializersMap
- 
Constructor Details- 
SentenceDetectorFactorypublic SentenceDetectorFactory()Creates aSentenceDetectorFactorythat provides the default implementation of the resources.
- 
SentenceDetectorFactorypublic 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-- trueif- TOKEN_END_PROPERTYshall be used,- falseotherwise.
- abbreviationDictionary- The- Dictionarywhich holds abbreviations.
- eosCharacters- The characters to be used to detect sentence endings.
 
 
- 
- 
Method Details- 
validateArtifactMapDescription copied from class:BaseToolFactoryValidates the parsed artifacts.Note: Subclasses should generally invoke super.validateArtifactMapat the beginning of this method.- Specified by:
- validateArtifactMapin class- BaseToolFactory
- Throws:
- InvalidFormatException- Thrown if validation found invalid states.
 
- 
createArtifactMapDescription copied from class: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.- Overrides:
- createArtifactMapin class- BaseToolFactory
- Returns:
- Retrieves a Mapwith pairs of keys and objects.
 
- 
createManifestEntries- Overrides:
- createManifestEntriesin class- BaseToolFactory
- Returns:
- Retrieves the manifest entries to be added to the model manifest.
 
- 
createpublic static SentenceDetectorFactory create(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbrDictionary, char[] eosChars) throws InvalidFormatException Instantiates aSentenceDetectorFactoryvia a givensubclassName.- Parameters:
- subclassName- The class name used for instantiation. If- null, an instance of- SentenceDetectorFactorywill be returned per default. Otherwise, the- ExtensionLoadermechanism is applied to load the requested- subclassName.
- languageCode- The ISO language code to be used. Must not be- null.
- useTokenEnd-- trueif- TOKEN_END_PROPERTYshall be set,- falseotherwise.
- abbrDictionary- The- Dictionaryof abbreviations if available; may be- null.
- eosChars- An array of characters representing end of sentence symbols / characters.
- Returns:
- A valid SentenceDetectorFactoryinstance.
- Throws:
- InvalidFormatException- Thrown if the- ExtensionLoadermechanism failed to create the factory associated with- subclassName.
 
- 
getEOSCharacterspublic char[] getEOSCharacters()
- 
isUseTokenEndpublic boolean isUseTokenEnd()
- 
getAbbreviationDictionary- Returns:
- An abbreviation Dictionaryornullif unset.
 
- 
getLanguageCode
- 
getEndOfSentenceScanner- Returns:
- An EndOfSentenceScannerinstance, guaranteed to be notnull.
 
- 
getSDContextGenerator- Returns:
- A SDContextGeneratorinstance, guaranteed to be notnull.
 
 
-