[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG/queryparser - Collector.py:1.1.2.3 TextIndexGgen.py:1.1.2.6 queryparser.py:1.1.2.11
Andreas Jung
andreas@digicool.com
Wed, 13 Feb 2002 12:05:37 -0500
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG/queryparser
In directory cvs.zope.org:/tmp/cvs-serv8996/queryparser
Modified Files:
Tag: ajung-textindexng-branch
Collector.py TextIndexGgen.py queryparser.py
Log Message:
added support for exact phrase searches
=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/queryparser/Collector.py 1.1.2.2 => 1.1.2.3 ===
'or' : 'txU',
'and' : 'txI',
- 'near' : 'txN'
+ 'near' : 'txN',
+ 'quote' : 'txQ'
}
class Collector(Stack):
=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/queryparser/TextIndexGgen.py 1.1.2.5 => 1.1.2.6 ===
@R R5 :: factor >> term and term
@R R5a :: factor >> term near term
+ @R R5b :: factor >> term quote term
@R R6 :: term >> str
@R R7 :: term >> openp expr closep
@@ -37,6 +38,7 @@
ANDREGEX = 'and'
ORREGEX = 'or'
NEARREGEX = 'near'
+QUOTEREGEX = 'quote'
STRREGEX = '[a-zA-Z]*'
OPENPREGEX = r'('
CLOSEPREGEX = r')'
@@ -45,6 +47,7 @@
def DeclareTerminals(Grammar):
Grammar.Addterm("openp", OPENPREGEX, '')
Grammar.Addterm("closep",CLOSEPREGEX, '')
+ Grammar.Addterm("quote", QUOTEREGEX, '')
Grammar.Addterm("near", NEARREGEX, '')
Grammar.Addterm("and", ANDREGEX, '')
Grammar.Addterm("or", ORREGEX, '')
=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/queryparser/queryparser.py 1.1.2.10 => 1.1.2.11 ===
"""
+ QUOTEREGEX = 'quote'
NEARREGEX = 'near'
ANDREGEX = 'and'
ORREGEX = 'or'
@@ -51,6 +52,7 @@
self.TextIndexG.Addterm("closep", self.CLOSEPREGEX, self.addCloseParens)
self.TextIndexG.Addterm("and", self.ANDREGEX, self.addOp)
self.TextIndexG.Addterm("near", self.NEARREGEX, self.addOp)
+ self.TextIndexG.Addterm("quote", self.QUOTEREGEX, self.addOp)
self.TextIndexG.Addterm("or", self.ORREGEX, self.addOp)
self.TextIndexG.Addterm("str", self.STRREGEX, self.addWord)