1. 20 May, 2002 8 commits
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
      Add Zope Copyright notice. · 90bae6a7
      Guido van Rossum authored
      90bae6a7
    • Guido van Rossum's avatar
      Add Zope Copyright notice. · 53c5d967
      Guido van Rossum authored
      Fix typo in docstring.
      53c5d967
    • Guido van Rossum's avatar
      QueryParser.py: · 47bb995d
      Guido van Rossum authored
      - Rephrased the description of the grammar, pointing out that the
        lexicon decides on globbing syntax.
      
      - Refactored term and atom parsing (moving atom parsing into a
        separate method).  The previously checked-in version accidentally
        accepted some invalid forms like ``foo AND -bar''; this is fixed.
      
      tests/testQueryParser.py:
      
      - Each test is now in a separate method; this produces more output
        (alas) but makes pinpointing the errors much simpler.
      
      - Added some tests catching ``foo AND -bar'' and similar.
      
      - Added an explicit test class for the handling of stopwords.  The
        "and/" test no longer has to check self.__class__.
      
      - Some refactoring of the TestQueryParser class; the utility methods
        are now in a base class TestQueryParserBase, in a different order;
        compareParseTrees() now shows the parse tree it got when raising an
        exception.  The parser is now self.parser instead of self.p (see
        below).
      
      tests/testZCTextIndex.py:
      
      - setUp() no longer needs to assign to self.p; the parser is
        consistently called self.parser now.
      47bb995d
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
      Refactor the query parser to rely on the lexicon for parsing terms. · b82b2746
      Guido van Rossum authored
      ILexicon.py:
      
        - Added parseTerms() and isGlob().
      
        - Added get_word(), get_wid() (get_word() is old; get_wid() for symmetry).
      
        - Reflowed some text.
      
      IQueryParser.py:
      
        - Expanded docs for parseQuery().
      
        - Added getIgnored() and parseQueryEx().
      
      IPipelineElement.py:
      
        - Added processGlob().
      
      Lexicon.py:
      
        - Added parseTerms() and isGlob().
      
        - Added get_wid().
      
        - Some pipeline elements now support processGlob().
      
      ParseTree.py:
      
        - Clarified the error message for calling executeQuery() on a
          NotNode.
      
      QueryParser.py (lots of changes):
      
        - Change private names __tokens etc. into protected _tokens etc.
      
        - Add getIgnored() and parseQueryEx() methods.
      
        - The atom parser now uses the lexicon's parseTerms() and isGlob()
          methods.
      
        - Query parts that consist only of stopwords (as determined by the
          lexicon), or of stopwords and negated terms, yield None instead of
          a parse tree node; the ignored term is added to self._ignored.
          None is ignored when combining terms for AND/OR/NOT operators, and
          when an operator has no non-None operands, the operator itself
          returns None.  When this None percolates all the way to the top,
          the parser raises a ParseError exception.
      
      tests/testQueryParser.py:
      
        - Changed test expressions of the form "a AND b AND c" to "aa AND bb
          AND cc" so that the terms won't be considered stopwords.
      
        - The test for "and/" can only work for the base class.
      
      tests/testZCTextIndex.py:
      
        - Added copyright notice.
      
        - Refactor testStopWords() to have two helpers, one for success, one
          for failures.
      
        - Change testStopWords() to require parser failure for those queries
          that have only stopwords or stopwords plus negated terms.
      
        - Improve compareSet() to sort the sets of keys, and use a more
          direct way of extracting the keys.  This wasn't strictly needed
          (nothing fails without this), but the old approach of copying the
          keys into a dict in a loop depends on the dict hashing to always
          return keys in the same order.
      b82b2746
    • Matt Behrens's avatar
      revert stopper setup.py-age; stopper is not in the Zope module. ok · 5f66a3ce
      Matt Behrens authored
      guido@.
      
      when/if merge day comes for the installer this will make for less
      confusion :-)
      5f66a3ce
  2. 19 May, 2002 6 commits
  3. 18 May, 2002 5 commits
  4. 17 May, 2002 21 commits