def test016(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     from Products.ZCTextIndex.ParseTree import NotNode
     self.expect("-foo bar",
                 AndNode([AtomNode("bar"),
                          NotNode(AtomNode("foo"))]))
Example #2
0
 def test006(self):
     self.expect(
         "(aa OR bb) AND (cc OR dd)",
         AndNode([
             OrNode([AtomNode("aa"), AtomNode("bb")]),
             OrNode([AtomNode("cc"), AtomNode("dd")])
         ]))
 def test004(self):
     from Products.ZCTextIndex.ParseTree import AtomNode
     from Products.ZCTextIndex.ParseTree import OrNode
     self.expect("aa OR bb or cc",
                 OrNode([AtomNode("aa"),
                         AtomNode("bb"),
                         AtomNode("cc")]))
 def test006(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     from Products.ZCTextIndex.ParseTree import OrNode
     self.expect("(aa OR bb) AND (cc OR dd)",
                 AndNode([OrNode([AtomNode("aa"), AtomNode("bb")]),
                          OrNode([AtomNode("cc"), AtomNode("dd")])]))
 def test007(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     from Products.ZCTextIndex.ParseTree import NotNode
     self.expect("aa AND NOT bb",
                 AndNode([AtomNode("aa"),
                          NotNode(AtomNode("bb"))]))
 def test025(self):
     # Split by Unicode fullwidth space
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     self.expect(u"foo\u3000bar",
                 AndNode([AtomNode(u"foo"),
                          AtomNode(u"bar")]))
Example #7
0
 def test005(self):
     self.expect(
         "aa AND bb OR cc AnD dd",
         OrNode([
             AndNode([AtomNode("aa"), AtomNode("bb")]),
             AndNode([AtomNode("cc"), AtomNode("dd")])
         ]))
 def test005(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     from Products.ZCTextIndex.ParseTree import OrNode
     self.expect("aa AND bb OR cc AnD dd",
                 OrNode([AndNode([AtomNode("aa"), AtomNode("bb")]),
                         AndNode([AtomNode("cc"), AtomNode("dd")])]))
 def test003(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     self.expect("aa and bb AND cc",
                 AndNode([AtomNode("aa"),
                          AtomNode("bb"),
                          AtomNode("cc")]))
 def test021(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     self.expect(
         'foo"bar"blech',
         AndNode([AtomNode("foo"),
                  AtomNode("bar"),
                  AtomNode("blech")]))
 def test018(self):
     from Products.ZCTextIndex.ParseTree import AndNode
     from Products.ZCTextIndex.ParseTree import AtomNode
     from Products.ZCTextIndex.ParseTree import NotNode
     from Products.ZCTextIndex.ParseTree import PhraseNode
     self.expect('booh -"foo bar"',
                 AndNode([AtomNode("booh"),
                          NotNode(PhraseNode(["foo", "bar"]))]))
Example #12
0
 def test019(self):
     self.expect('foo"bar"', AndNode([AtomNode("foo"), AtomNode("bar")]))
Example #13
0
 def test018(self):
     self.expect(
         'booh -"foo bar"',
         AndNode([AtomNode("booh"),
                  NotNode(PhraseNode(["foo", "bar"]))]))
Example #14
0
 def test003(self):
     self.expect("aa and bb AND cc",
                 AndNode([AtomNode("aa"),
                          AtomNode("bb"),
                          AtomNode("cc")]))
Example #15
0
 def test001(self):
     self.expect("foo", AtomNode("foo"))
Example #16
0
 def test205(self):
     self.expect('foo OR stop', AtomNode("foo"), ["stop"])
Example #17
0
 def test023(self):
     self.expect("foo* bar", AndNode([GlobNode("foo*"), AtomNode("bar")]))
Example #18
0
 def test020(self):
     self.expect('"foo"bar', AndNode([AtomNode("foo"), AtomNode("bar")]))
Example #19
0
 def test021(self):
     self.expect(
         'foo"bar"blech',
         AndNode([AtomNode("foo"),
                  AtomNode("bar"),
                  AtomNode("blech")]))
Example #20
0
 def test203(self):
     self.expect('foo AND NOT stop', AtomNode("foo"), ["stop"])
Example #21
0
 def test201(self):
     self.expect('and/', AtomNode("and"))
Example #22
0
 def test007(self):
     self.expect("aa AND NOT bb",
                 AndNode([AtomNode("aa"),
                          NotNode(AtomNode("bb"))]))
Example #23
0
 def test204(self):
     self.expect('stop AND foo', AtomNode("foo"), ["stop"])
Example #24
0
 def test011(self):
     self.expect("foo bar", AndNode([AtomNode("foo"), AtomNode("bar")]))
Example #25
0
 def test206(self):
     self.expect('stop OR foo', AtomNode("foo"), ["stop"])
Example #26
0
 def test013(self):
     self.expect("((foo bar))", AndNode([AtomNode("foo"), AtomNode("bar")]))
Example #27
0
 def test002(self):
     self.expect("note", AtomNode("note"))
Example #28
0
 def test016(self):
     self.expect("-foo bar",
                 AndNode([AtomNode("bar"),
                          NotNode(AtomNode("foo"))]))
Example #29
0
 def test004(self):
     self.expect("aa OR bb or cc",
                 OrNode([AtomNode("aa"),
                         AtomNode("bb"),
                         AtomNode("cc")]))
Example #30
0
 def test017(self):
     self.expect(
         "booh -foo-bar",
         AndNode([AtomNode("booh"),
                  NotNode(PhraseNode(["foo", "bar"]))]))