public class DefaultLanguageDetectorContextGenerator extends Object implements LanguageDetectorContextGenerator
| Constructor and Description |
|---|
DefaultLanguageDetectorContextGenerator(int minLength,
int maxLength,
CharSequenceNormalizer... normalizers)
Creates a customizable @
DefaultLanguageDetectorContextGenerator that computes ngrams from text |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getContext(CharSequence document)
Generates the context for a document using character ngrams.
|
public DefaultLanguageDetectorContextGenerator(int minLength,
int maxLength,
CharSequenceNormalizer... normalizers)
DefaultLanguageDetectorContextGenerator that computes ngrams from textminLength - min ngrams charsmaxLength - max ngrams charsnormalizers - zero or more normalizers to
be applied in to the text before extracting ngramspublic String[] getContext(CharSequence document)
getContext in interface LanguageDetectorContextGeneratordocument - document to extract context fromCopyright © 2017 The Apache Software Foundation. All rights reserved.