aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/prelude/semantics/test/EquivTestCase.java
blob: b259d49c0ddb6104e4b2e795648029dabba2bc0c (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;

/**
 * @author bratseth
 */
public class EquivTestCase extends RuleBaseAbstractTestCase {

    public EquivTestCase() {
        super("equiv.sr");
    }

    @Test
    void testEquiv() {
        assertSemantics("EQUIV \"lord of the rings\" lotr", "lotr");
    }

    @Test
    void testEquivWithFollowingQuery() {
        assertSemantics("AND (EQUIV \"lord of the rings\" lotr) is a movie", "lotr is a movie");
    }

    @Test
    void testEquivWithPrecedingQuery() {
        assertSemantics("AND a movie is (EQUIV \"lord of the rings\" lotr)", "a movie is lotr");
    }

    @Test
    void testEquivWithSurroundingQuery() {
        assertSemantics("AND a movie is (EQUIV \"lord of the rings\" lotr) yes", "a movie is lotr yes");
    }

}