Class DefaultSDContextGenerator

java.lang.Object
opennlp.tools.sentdetect.DefaultSDContextGenerator
All Implemented Interfaces:
opennlp.tools.sentdetect.SDContextGenerator
Direct Known Subclasses:
SentenceContextGenerator

public class DefaultSDContextGenerator extends Object implements opennlp.tools.sentdetect.SDContextGenerator
Generate event contexts for maxent decisions for sentence detection.
  • 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

      public DefaultSDContextGenerator(Set<String> inducedAbbreviations, char[] eosCharacters)
      Creates a new SDContextGenerator instance which uses the set of induced abbreviations.
      Parameters:
      inducedAbbreviations - a Set of Strings representing induced abbreviations in the training data. Example: "Mr."
      eosCharacters - The characters to be used to detect sentence endings.
  • Method Details

    • getContext

      public String[] getContext(CharSequence sb, int position)
      Specified by:
      getContext in interface opennlp.tools.sentdetect.SDContextGenerator