aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/semantics/benchmark/rules.sr
blob: d7f7db215e39d662494b0663200ff3ce4387de5b (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
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# Local use case

[listing] [preposition] [place] -> listing:[listing] place:[place];

[listing] :- restaurant, shop, cafe, hotel;

[preposition] :- in, at, near;

[place] :- [street] [city], [street];

[street] :- geary street, geary;
[city] :- san francisco;

# Shopping use case

[brand] -> brand:[brand];
[category] -> category:[category];

[brand] :- sony, dell;                       # Refer to automata later
[category] :- digital camera, camera, phone; # Ditto

# Travel use case, note how explicit reference name overrides named condition as reference name

# [from:place] [to:place] -> from:[from] to:[to]

# Answers use case

# why is [noun] ... [adjective] +> ?about:[noun]

# Adding rule using the default query mode (and/or)

[foobar] +> foobar:[foobar];

[foobar] :- foo, bar;

# Adding rank rule

[word] +> $foobar:[word];

[word] :- aardwark, word;

# Literal production

lotr -> lord of the rings;

# Adding a negative

java +> -coffee;

# Adding another negative
# TODO: Term types in conditions
# java -coffee +> -island

# "Stopwords"

be -> ;
the -> ;

[stopword] -> ;

[stopword] :- to, or, not;