Exemplo n.º 1
0
 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"))]))
Exemplo n.º 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")])
         ]))
Exemplo n.º 3
0
 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")])]))
Exemplo n.º 5
0
 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"))]))
Exemplo n.º 6
0
 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")]))
Exemplo n.º 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")])]))
Exemplo n.º 9
0
 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")]))
Exemplo n.º 10
0
 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")]))
Exemplo n.º 11
0
 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"]))]))
Exemplo n.º 12
0
 def test019(self):
     self.expect('foo"bar"', AndNode([AtomNode("foo"), AtomNode("bar")]))
Exemplo n.º 13
0
 def test018(self):
     self.expect(
         'booh -"foo bar"',
         AndNode([AtomNode("booh"),
                  NotNode(PhraseNode(["foo", "bar"]))]))
Exemplo n.º 14
0
 def test003(self):
     self.expect("aa and bb AND cc",
                 AndNode([AtomNode("aa"),
                          AtomNode("bb"),
                          AtomNode("cc")]))
Exemplo n.º 15
0
 def test001(self):
     self.expect("foo", AtomNode("foo"))
Exemplo n.º 16
0
 def test205(self):
     self.expect('foo OR stop', AtomNode("foo"), ["stop"])
Exemplo n.º 17
0
 def test023(self):
     self.expect("foo* bar", AndNode([GlobNode("foo*"), AtomNode("bar")]))
Exemplo n.º 18
0
 def test020(self):
     self.expect('"foo"bar', AndNode([AtomNode("foo"), AtomNode("bar")]))
Exemplo n.º 19
0
 def test021(self):
     self.expect(
         'foo"bar"blech',
         AndNode([AtomNode("foo"),
                  AtomNode("bar"),
                  AtomNode("blech")]))
Exemplo n.º 20
0
 def test203(self):
     self.expect('foo AND NOT stop', AtomNode("foo"), ["stop"])
Exemplo n.º 21
0
 def test201(self):
     self.expect('and/', AtomNode("and"))
Exemplo n.º 22
0
 def test007(self):
     self.expect("aa AND NOT bb",
                 AndNode([AtomNode("aa"),
                          NotNode(AtomNode("bb"))]))
Exemplo n.º 23
0
 def test204(self):
     self.expect('stop AND foo', AtomNode("foo"), ["stop"])
Exemplo n.º 24
0
 def test011(self):
     self.expect("foo bar", AndNode([AtomNode("foo"), AtomNode("bar")]))
Exemplo n.º 25
0
 def test206(self):
     self.expect('stop OR foo', AtomNode("foo"), ["stop"])
Exemplo n.º 26
0
 def test013(self):
     self.expect("((foo bar))", AndNode([AtomNode("foo"), AtomNode("bar")]))
Exemplo n.º 27
0
 def test002(self):
     self.expect("note", AtomNode("note"))
Exemplo n.º 28
0
 def test016(self):
     self.expect("-foo bar",
                 AndNode([AtomNode("bar"),
                          NotNode(AtomNode("foo"))]))
Exemplo n.º 29
0
 def test004(self):
     self.expect("aa OR bb or cc",
                 OrNode([AtomNode("aa"),
                         AtomNode("bb"),
                         AtomNode("cc")]))
Exemplo n.º 30
0
 def test017(self):
     self.expect(
         "booh -foo-bar",
         AndNode([AtomNode("booh"),
                  NotNode(PhraseNode(["foo", "bar"]))]))