Klasse DefaultTokenContextGenerator

java.lang.Object
opennlp.tools.tokenize.DefaultTokenContextGenerator
Alle implementierten Schnittstellen:
TokenContextGenerator

public class DefaultTokenContextGenerator extends Object implements TokenContextGenerator
A default TokenContextGenerator which produces events for maxent decisions for tokenization.
  • Konstruktordetails

    • DefaultTokenContextGenerator

      public DefaultTokenContextGenerator()
      Initializes a plain DefaultTokenContextGenerator instance.
    • DefaultTokenContextGenerator

      public DefaultTokenContextGenerator(Set<String> inducedAbbreviations)
      Initializes a customized DefaultTokenContextGenerator instance via a set of inducedAbbreviations.
      Parameter:
      inducedAbbreviations - The induced abbreviations to be used for this instance.
  • Methodendetails

    • getContext

      public String[] getContext(String sentence, int index)
      Angegeben von:
      getContext in Schnittstelle TokenContextGenerator
      Parameter:
      sentence - The string that represents a sentence.
      index - The index to consider splitting tokens.
      Gibt zurück:
      An array of features for a sentence at the specified index.