blob: fbe40494231cd45026b4b78f4c5a3936b98fae71 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.query.parser;
import com.yahoo.collections.Tuple2;
import com.yahoo.component.Version;
import com.yahoo.language.Linguistics;
import com.yahoo.language.detect.Detector;
import com.yahoo.language.process.*;
import com.yahoo.language.simple.SimpleLinguistics;
/**
* @author Simon Thoresen Hult
*/
public class TestLinguistics implements Linguistics {
public static final Linguistics INSTANCE = new TestLinguistics();
private final Linguistics linguistics = new SimpleLinguistics();
private TestLinguistics() {
// hide
}
@Override
public Stemmer getStemmer() {
return linguistics.getStemmer();
}
@Override
public com.yahoo.language.process.Tokenizer getTokenizer() {
return linguistics.getTokenizer();
}
@Override
public Normalizer getNormalizer() {
return linguistics.getNormalizer();
}
@Override
public Transformer getTransformer() {
return linguistics.getTransformer();
}
@Override
public Segmenter getSegmenter() {
return new TestSegmenter();
}
@Override
public Detector getDetector() {
return linguistics.getDetector();
}
@Override
public GramSplitter getGramSplitter() {
return linguistics.getGramSplitter();
}
@Override
public CharacterClasses getCharacterClasses() {
return linguistics.getCharacterClasses();
}
@Override
public Tuple2<String, Version> getVersion(Linguistics.Component component) {
return linguistics.getVersion(component);
}
}
|