This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3439 - MildNot using wrong position info and not extended to properly handle phrases
Summary: MildNot using wrong position info and not extended to properly handle phrases
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Full Text 1.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jochen Doerre
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://www.w3.org/TR/xquery-full-text...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-07 16:32 UTC by Joaquin Delgado
Modified: 2006-09-14 17:46 UTC (History)
0 users

See Also:


Attachments

Description Joaquin Delgado 2006-07-07 16:32:49 UTC
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")
   else
      <fts:allMatches stokenNum="{$allMatches1/@stokenNum}">
      {
         let $posSet2 := $allMatches2/fts:match/fts:stringInclude/@queryPos
         return 
            $allMatches1/fts:match[
               every $pos1 in ./fts:stringInclude/@queryPos, 
                     $pos2 in $posSet2
               satisfies $pos1 ne $pos2]
      }
      </fts:allMatches>
};
Comment 1 Jochen Doerre 2006-09-14 17:46:50 UTC
The resolution has been added to the Specs.