diff options
Diffstat (limited to 'container-search/src/main/java/com/yahoo/prelude/semantics/benchmark/rules.sr')
-rw-r--r-- | container-search/src/main/java/com/yahoo/prelude/semantics/benchmark/rules.sr | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/benchmark/rules.sr b/container-search/src/main/java/com/yahoo/prelude/semantics/benchmark/rules.sr new file mode 100644 index 00000000000..020699ba7cb --- /dev/null +++ b/container-search/src/main/java/com/yahoo/prelude/semantics/benchmark/rules.sr @@ -0,0 +1,62 @@ +# Copyright 2016 Yahoo Inc. 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; |