aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/prelude/semantics/test/NoStemmingTestCase.java
blob: 0bcafa6892808adbc1201b51427a084fdf05e11e (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.semantics.test;

import org.junit.jupiter.api.Test;

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

    public NoStemmingTestCase() {
        super("nostemming.sr");
    }

    /** Should rewrite correctly */
    @Test
    void testCorrectRewriting1() {
        assertSemantics("+(AND i:arts i:sciences TRUE) -i:b", "i:as -i:b");
    }

    /** Should rewrite correctly too */
    @Test
    void testCorrectRewriting2() {
        assertSemantics("+(AND i:arts i:sciences i:crafts TRUE) -i:b", "i:asc -i:b");
    }

    /** Should not rewrite */
    @Test
    void testNoRewriting() {
        assertSemantics("+i:a -i:s", "i:a -i:s");
    }

}