<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>9448</bug_id>
          
          <creation_ts>2010-04-08 13:33:14 +0000</creation_ts>
          <short_desc>Some bugs with the FTScope in full text</short_desc>
          <delta_ts>2011-01-06 01:21:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Full Text 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>xero_123</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jmdyck</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>34657</commentid>
    <comment_count>0</comment_count>
    <who name="">xero_123</who>
    <bug_when>2010-04-08 13:33:14 +0000</bug_when>
    <thetext>I think that there is some bugs with the FTScope.
Let we see the function  fts:ApplyFTScopeDifferentSentence in the XQuery and XPath Full Text 1.0 W3C Candidate Recommendation 28 January 2010.



OK! I think that if we have a stringInclude1 which tokenInfo/@startSent != tokenInfo/endSentSent in the match, and then this stringInclude1 will always be 

right ,no matter what the $stringInclude2 is. Right or not?

On the other hand,if we have a stringInclude1 which tokenInfo/@startSent == tokenInfo/endSentSent in the match,and then this stringInclude1 will always be 

wrong ,because the $stringInclude2 maybe the same of  stringInclude1.

so I think we should change the &apos;where sub&apos; is &apos;where every $stringInclude in $match/fts:stringInclude satisfies ($stringInclude1/fts:tokenInfo/@startSent != 

$stringInclude1/fts:tokenInfo/@endSent &apos;.

I am a chinese student.So there may be some grammatical errors, and I am sorry.

MY EMail:guoxiaolei_neu@163.com

Look forward to your reply!!!!
 

Function Content:

	declare function fts:ApplyFTScopeDifferentSentence (
      $allMatches as element(fts:allMatches) ) 
   as element(fts:allMatches) 
{
   &lt;fts:allMatches stokenNum=&quot;{$allMatches/@stokenNum}&quot;&gt;
   {
      for $match in $allMatches/fts:match
      where every $stringInclude1 in $match/fts:stringInclude,
                  $stringInclude2 in $match/fts:stringInclude  
            satisfies ($stringInclude1/fts:tokenInfo/@startSent !=  
                       $stringInclude2/fts:tokenInfo/@startSent 
                    or $stringInclude1/fts:tokenInfo/@startSent !=  
                       $stringInclude1/fts:tokenInfo/@endSent 
                    or $stringInclude2/fts:tokenInfo/@startSent !=  
                       $stringInclude2/fts:tokenInfo/@endSent ) 
                   and $stringInclude1/fts:tokenInfo/@startSent &gt; 0 
                   and $stringInclude2/fts:tokenInfo/@endSent &gt; 0
      return 
         &lt;fts:match&gt;
         {
            $match/fts:stringInclude,
            for $stringExcl in $match/fts:stringExclude
            where every $stringIncl in $match/fts:stringInclude
                  satisfies ($stringIncl/fts:tokenInfo/@startSent !=  
                             $stringExcl/fts:tokenInfo/@startSent 
                          or $stringIncl/fts:tokenInfo/@startSent !=  
                             $stringIncl/fts:tokenInfo/@endSent 
                          or $stringExcl/fts:tokenInfo/@startSent !=  
                             $stringExcl/fts:tokenInfo/@endSent ) 
                         and $stringIncl/fts:tokenInfo/@startSent &gt; 0 
                         and $stringExcl/fts:tokenInfo/@endSent &gt; 0
            return $stringExcl
         }
         &lt;/fts:match&gt;
   }
   &lt;/fts:allMatches&gt;
};</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35715</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2010-05-16 04:32:28 +0000</bug_when>
    <thetext>&gt; I think that if we have a stringInclude1 which tokenInfo/@startSent !=
&gt; tokenInfo/endSentSent in the match, and then this stringInclude1 will always be 
&gt; right, no matter what the $stringInclude2 is.

That depends on what you mean by &quot;right&quot;. The condition in the QuantifiedExpr will be satisfied for that $stringInclude1 no matter what $stringInclude2 is. 

&gt; On the other hand, if we have a stringInclude1 which tokenInfo/@startSent ==
&gt; tokenInfo/endSentSent in the match, and then this stringInclude1 will always be 
&gt; wrong, because the $stringInclude2 maybe the same of  stringInclude1.

Hmm. So when an &quot;input&quot; match contains a stringInclude that starts and ends within the same sentence, that match cannot succeed, because the QuantifiedExpr&apos;s condition will return false when $stringInclude1 and $stringInclude2 are both bound to that stringInclude. Yeah, that&apos;s a bug.

(The condition used to begin with
    $stringInclude1 is $stringInclude2 or ...
to &quot;skip over&quot; the cases where the two variables were bound to the same stringInclude, but that had a bug too: a match containing a single stringInclude would always succeed.)

We&apos;ll have to take another crack at writing that function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38493</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2010-09-07 04:08:31 +0000</bug_when>
    <thetext>At meeting #437 on 2010-05-18, the Working Groups agreed to change the &apos;where&apos; clause in fts:ApplyFTScopeDifferentSentence() as follows:

      where
            count($match/fts:stringInclude) &gt; 1
            and
            every $stringInclude1 in $match/fts:stringInclude,
                  $stringInclude2 in $match/fts:stringInclude  
            satisfies
               $stringInclude1 is $stringInclude2
               or
               (
                  [pre-existing &apos;satisfies&apos; condition]
               )

We believe this fixes the bug you discovered. Therefore, I am marking this bug resolved-FIXED. If you agree with this resolution, please mark it CLOSED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43483</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2010-12-20 20:28:11 +0000</bug_when>
    <thetext>(By the way, the function fts:ApplyFTScopeDifferentParagraph had the same bug as fts:ApplyFTScopeDifferentSentence, and was also fixed by the change in comment #2.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>