Package opennlp.tools.sentdetect
Class SentenceDetectorFactory
- java.lang.Object
 - 
- opennlp.tools.util.BaseToolFactory
 - 
- opennlp.tools.sentdetect.SentenceDetectorFactory
 
 
 
- 
public class SentenceDetectorFactory extends BaseToolFactory
The factory that providesSentenceDetectordefault implementations and resources 
- 
- 
Constructor Summary
Constructors Constructor Description SentenceDetectorFactory()Creates aSentenceDetectorFactorythat provides the default implementation of the resources.SentenceDetectorFactory(String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters)Creates aSentenceDetectorFactory. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SentenceDetectorFactorycreate(String subclassName, String languageCode, boolean useTokenEnd, Dictionary abbreviationDictionary, char[] eosCharacters)Map<String,Object>createArtifactMap()A model's implementation should call this constructor that creates a model programmatically.Map<String,String>createManifestEntries()DictionarygetAbbreviationDictionary()EndOfSentenceScannergetEndOfSentenceScanner()char[]getEOSCharacters()StringgetLanguageCode()SDContextGeneratorgetSDContextGenerator()booleanisUseTokenEnd()voidvalidateArtifactMap()Validates the parsed artifacts.- 
Methods inherited from class opennlp.tools.util.BaseToolFactory
create, create, createArtifactSerializersMap 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
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.- Parameters:
 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.
 
 - 
 
- 
Method Detail
- 
validateArtifactMap
public void validateArtifactMap() throws InvalidFormatExceptionDescription copied from class:BaseToolFactoryValidates the parsed artifacts.Note: Subclasses should generally invoke
super.validateArtifactMapat the beginning of this method.- Specified by:
 validateArtifactMapin classBaseToolFactory- Throws:
 InvalidFormatException- Thrown if validation found invalid states.
 
- 
createArtifactMap
public Map<String,Object> createArtifactMap()
Description 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 classBaseToolFactory- Returns:
 - Retrieves a 
Mapwith pairs of keys and objects. 
 
- 
createManifestEntries
public Map<String,String> createManifestEntries()
- Overrides:
 createManifestEntriesin 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
public Dictionary getAbbreviationDictionary()
 
- 
getLanguageCode
public String getLanguageCode()
 
- 
getEndOfSentenceScanner
public EndOfSentenceScanner getEndOfSentenceScanner()
 
- 
getSDContextGenerator
public SDContextGenerator getSDContextGenerator()
 
 - 
 
 -