Package opennlp.tools.langdetect

# Class DefaultLanguageDetectorContextGenerator

java.lang.Object
opennlp.tools.langdetect.DefaultLanguageDetectorContextGenerator

All Implemented Interfaces:
  `Serializable`, `opennlp.tools.langdetect.LanguageDetectorContextGenerator`

public class DefaultLanguageDetectorContextGenerator extends Object implements opennlp.tools.langdetect.LanguageDetectorContextGenerator
A context generator for `language detector`.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultLanguageDetectorContextGenerator(int minLength, int maxLength, opennlp.tools.util.normalizer.CharSequenceNormalizer... normalizers)`
  Creates a customizable `DefaultLanguageDetectorContextGenerator` that computes ngrams from text.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `<T extends CharSequence>
  T[]`
  `getContext(CharSequence document)`

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

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

- ## Constructor Details

  - ### DefaultLanguageDetectorContextGenerator

    public DefaultLanguageDetectorContextGenerator(int minLength, int maxLength, opennlp.tools.util.normalizer.CharSequenceNormalizer... normalizers)
    Creates a customizable `DefaultLanguageDetectorContextGenerator` that computes ngrams from text.
    Parameters:
      `minLength` - The min number of ngrams characters. Must be greater than `0`.
      `maxLength` - The max number of ngrams characters. Must be greater than `0` and must be greater than `minLength`.
      `normalizers` - Zero or more normalizers to be applied in to the text before extracting ngrams.

- ## Method Details

  - ### getContext

    public <T extends CharSequence> T[] getContext(CharSequence document)
    Specified by:
      `getContext` in interface `opennlp.tools.langdetect.LanguageDetectorContextGenerator`