Factory (Apache OpenNLP :: Core :: Runtime 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.tokenize.lang, class: Factory

Package opennlp.tools.tokenize.lang

# Class Factory

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

public class Factory extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Pattern`
  `DEFAULT_ALPHANUMERIC`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Factory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `opennlp.tools.tokenize.TokenContextGenerator`
  `createTokenContextGenerator(String languageCode, Set<String> abbreviations)`
  Initializes a customized `TokenContextGenerator` via a set of `abbreviations`.
  `Pattern`
  `getAlphanumeric(String languageCode)`
  Gets the alphanumeric pattern for a language.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 opennlp.tools.tokenize.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.