summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/prelude/semantics/test/StemmingTestCase.java
blob: 006b0b5a6a63403e1bbf9409bbbdc51c31df0438 (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.semantics.test;

/**
 * Tests a case reported by tularam
 *
 * @author bratseth
 */
public class StemmingTestCase extends RuleBaseAbstractTestCase {

    public StemmingTestCase(String name) {
        super(name,"stemming.sr");
    }

    public void testRewritingDueToStemmingInQuery() {
        assertSemantics("+i:vehicle -i:s","i:cars -i:s");
    }

    public void testRewritingDueToStemmingInRule() {
        assertSemantics("+i:animal -i:s","i:horse -i:s");
    }

    public void testRewritingDueToExactMatch() {
        assertSemantics("+(AND i:arts i:sciences) -i:s","i:as -i:s");
    }

    public void testNoRewritingBecauseShortWordsAreNotStemmed() {
        assertSemantics("+i:a -i:s","i:a -i:s");
    }

}