summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--examples/lucene_grammar.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index a6e7415..055b10c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,7 +21,6 @@ script:
- python unitTests.py
- python simple_unit_tests.py
- PYTHONPATH=. python examples/numerics.py
- - PYTHONPATH=. python examples/lucene_grammar.py
- PYTHONPATH=. python examples/TAP.py
- PYTHONPATH=. python examples/romanNumerals.py
- PYTHONPATH=. python examples/sexpParser.py
diff --git a/examples/lucene_grammar.py b/examples/lucene_grammar.py
index 2791b7c..6afaad4 100644
--- a/examples/lucene_grammar.py
+++ b/examples/lucene_grammar.py
@@ -19,7 +19,7 @@ keyword = and_ | or_ | not_ | to_
expression = Forward()
-valid_word = Regex(r'([a-zA-Z0-9*_+.-]|\\[!(){}\[\]^"~*?\\:])+').setName("word")
+valid_word = Regex(r'([a-zA-Z0-9*_+.-]|\\\\|\\([+\-!(){}\[\]^"~*?:]|\|\||&&))+').setName("word")
valid_word.setParseAction(
lambda t : t[0].replace('\\\\',chr(127)).replace('\\','').replace(chr(127),'\\')
)
@@ -57,6 +57,7 @@ expression << infixNotation(term,
# test strings taken from grammar description doc, and TestQueryParser.java
tests = r"""
+ # Success tests
a and b
a and not b
a and !b
@@ -225,6 +226,8 @@ tests = r"""
\*
*
\\
+ \||
+ \&&
a\:b\:c
a\\b\:c
a\:b\\c
@@ -266,6 +269,7 @@ tests = r"""
"""
failtests = r"""
+ # Failure tests
field:term:with:colon some more terms
(sub query)^5.0^2.0 plus more
a:b:c