W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2006

[Bug 3439] MildNot using wrong position info and not extended to properly handle phrases

From: <bugzilla@wiggum.w3.org>
Date: Fri, 07 Jul 2006 16:32:49 +0000
To: public-qt-comments@w3.org
Message-Id: <E1FytG5-0000vW-Vv@wiggum.w3.org>


           Summary: MildNot using wrong position info and not extended to
                    properly handle phrases
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
               URL: http://www.w3.org/TR/xquery-full-text/#ftmildnot
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Full Text
        AssignedTo: jim.melton@acm.org
        ReportedBy: joaquin.delgado@oracle.com
         QAContact: public-qt-comments@w3.org

In the following function (ApplyFTMildNot) all occurences of @queryPos, which
is just the position of the token in the query, should be replaced by
fts:tokenInfo/@startPos which corresponds to the match position because that is
what is really being compared.

However I would argue that comparing the starting position (verifying that all
the matches "satisfies $pos1 ne $pos2") is not sufficient. Specially in cases
where the word that matches in the first allmatches is not the first word of
the phrase in the second allmatches or two phrases are the operands.

For example:

- FTSelection ("Ford" mildnot "Francis Ford Coppola")
- FTSelection ("Ford Mustang" mildnot "Ford Mustang Special Edition")

declare function fts:ApplyFTMildNot (
      $allMatches1 as element(fts:allMatches),
      $allMatches2 as element(fts:allMatches) ) 
   as element(fts:allMatches)
   if (fn:count($allMatches2//fts:stringExclude) gt 0) then
      fn:error("Invalid expression on the right-hand side of a not-in")
      <fts:allMatches stokenNum="{$allMatches1/@stokenNum}">
         let $posSet2 := $allMatches2/fts:match/fts:stringInclude/@queryPos
               every $pos1 in ./fts:stringInclude/@queryPos, 
                     $pos2 in $posSet2
               satisfies $pos1 ne $pos2]
Received on Friday, 7 July 2006 16:33:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:29 UTC