blob: 0cf4634c6c30d4bb1460535950a318bdb6db62d1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.language.opennlp;
import opennlp.tools.langdetect.LanguageDetectorContextGenerator;
/**
* Overrides the UrlCharSequenceNormalizer, which has a bad regex, until fixed: https://issues.apache.org/jira/browse/OPENNLP-1350
*
* @author jonmv
*/
@SuppressWarnings("unused") // Loaded by black magic: specified in properties in the loaded model.
public class LanguageDetectorFactory extends opennlp.tools.langdetect.LanguageDetectorFactory {
@Override
public LanguageDetectorContextGenerator getContextGenerator() {
return new DefaultLanguageDetectorContextGenerator(1, 3,
VespaCharSequenceNormalizer.getInstance());
}
}
|