[Bug 5633] INCORRECT DISTANCE COMPUTATION IN FTDISTANCE

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5633

           Summary: INCORRECT DISTANCE COMPUTATION IN FTDISTANCE
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Full Text 1.0
        AssignedTo: jim.melton@acm.org
        ReportedBy: thomas.baby@oracle.com
         QAContact: public-qt-comments@w3.org


The FTDistance functions rely on computing word distance, sentence distance, or
paragraph distance, which are implemented in functions wordDistance,
sentenceDistance, or paraDistance respectively. These functions do not return
the absolute value of the distance, and this leads to some "funny" semantics in
the presence of exclusions. 

For example, in function fts:ApplyFTWordDistanceAtMost, we say that for each
stringExclude, there has to be at least one stringInclude from which it is not
more than a certain word distance apart. 

for $stringExcl in $match/fts:stringExclude
where some $stringIncl in $match/fts:stringInclude
      satisfies fts:wordDistance(
                    $stringIncl/fts:tokenInfo,
                    $stringExcl/fts:tokenInfo
                ) <= $n
return $stringExcl

But, since distance returned by wordDistance is not absolute, the result can be
different depending on whether the stringExclude occcurs "before" and "after" a
stringInclude. Intuitively, this does not make sense.

Received on Monday, 7 April 2008 22:54:14 UTC