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
71
|
# 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], [city], [state];
[street] :- geary street, geary;
[city] :- san francisco, paris;
[state] :- texas;
# 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 to/[place] -> from:[from] to:[to];
# 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 an or term
something +> ?somethingelse;
# Adding another negative
# TODO: Term types in conditions
# java -coffee +> -island
# "Stopwords" removal
be -> ;
the -> ;
[stopword] -> ;
[stopword] :- to,
or,
not;
# Changing term type
[typechange] -> $default:[typechange] ;
[typechange] :- typechange;
|