Class Factory

java.lang.Object
opennlp.tools.tokenize.lang.Factory

public class Factory extends Object
  • Field Details

    • DEFAULT_ALPHANUMERIC

      public static final Pattern DEFAULT_ALPHANUMERIC
  • Constructor Details

    • Factory

      public Factory()
  • Method Details

    • getAlphanumeric

      public Pattern getAlphanumeric(String languageCode)
      Gets the alphanumeric pattern for a language.
      Parameters:
      languageCode - The ISO_639-1 code. If null, or unknown, the DEFAULT_ALPHANUMERIC pattern will be returned.
      Returns:
      The alphanumeric Pattern for the language, or the default pattern.
    • createTokenContextGenerator

      public TokenContextGenerator createTokenContextGenerator(String languageCode, Set<String> abbreviations)
      Initializes a customized TokenContextGenerator via a set of abbreviations.
      Parameters:
      languageCode - The ISO_639-1 code to be used.
      abbreviations - The abbreviations to be used for new instance.