Package opennlp.tools.sentdetect
Class DefaultSDContextGenerator
java.lang.Object
opennlp.tools.sentdetect.DefaultSDContextGenerator
- All Implemented Interfaces:
SDContextGenerator
- Direct Known Subclasses:
SentenceContextGenerator
Generate event contexts for maxent decisions for sentence detection.
-
Constructor Summary
ConstructorDescriptionDefaultSDContextGenerator
(char[] eosCharacters) Creates a new instance with no induced abbreviations.DefaultSDContextGenerator
(Set<String> inducedAbbreviations, char[] eosCharacters) Creates a newSDContextGenerator
instance which uses the set of induced abbreviations. -
Method Summary
Modifier and TypeMethodDescriptionString[]
getContext
(CharSequence sb, int position) Returns an array of contextual features for the potential sentence boundary at the specified position within the specified string buffer.
-
Constructor Details
-
DefaultSDContextGenerator
public DefaultSDContextGenerator(char[] eosCharacters) Creates a new instance with no induced abbreviations.- Parameters:
eosCharacters
- The characters to be used to detect sentence endings.
-
DefaultSDContextGenerator
Creates a newSDContextGenerator
instance which uses the set of induced abbreviations.- Parameters:
inducedAbbreviations
- aSet
of Strings representing induced abbreviations in the training data. Example: "Mr."eosCharacters
- The characters to be used to detect sentence endings.
-
-
Method Details
-
getContext
Description copied from interface:SDContextGenerator
Returns an array of contextual features for the potential sentence boundary at the specified position within the specified string buffer.- Specified by:
getContext
in interfaceSDContextGenerator
- Parameters:
sb
- TheString
for which sentences are being determined.position
- An index into the specified string buffer when a sentence boundary may occur.- Returns:
- an array of contextual features for the potential sentence boundary at the
specified
position
within the specified string buffer.
-