title: Punctuation and Near Query
body: <p>When I turned on <code>punctuation-insensitive</code> in my <code>cts:word-query</code>, even then the <code>NEAR</code> query is breaking the <code>-</code> word into two words</p>
  
  <pre><code>let $xml :=
  
    &lt;abstracts count="1"&gt;
              &lt;abstract&gt;
                &lt;abstract_text count="1"&gt;
                  &lt;p&gt;We assessed the impact of a pharmacotherapy follow-up programme on key safety points [adverse events (AE) 
                  and drug administration] in outpatients treated with oral antineoplastic agents (OAA). We performed a comparative, 
                  interventional, quasi-experimental study of outpatients treated with OAA in a Spanish hospital to compare pre-intervention 
                  group patients (not monitored by pharmacists during 2011) with intervention group patients (prospectively monitored by 
                  pharmacists during 2013). AE data were collected from medical records. Follow-up was 6 months, and 249 patients were 
                  included (pre-intervention, 115; intervention, 134). After the first month, AE were detected in 86.5% of patients 
                  in the pre-intervention group and 80.6% of patients in the intervention group, P = 0.096. During the remaining months, 
                  79.0% patients had at least one AE in the pre-intervention group compared with 78.0% in the intervention group, P = 0.431. 
                  AE were more prevalent with sorafenib and sunitinib. In total, 173 drug interactions were recorded (pre-intervention, 80; 
                  intervention, 93; P = 0.045). Drug interactions were more frequent with erlotinib and gefitinib; food interactions were 
                  more common with sorafenib and pazopanib. Our follow-up of cancer outpatients revealed a reduction in severe AE and major 
                  drug interactions, thus helping health professionals to monitor the safety of OAA.&lt;/p&gt;
                &lt;/abstract_text&gt;
              &lt;/abstract&gt;
            &lt;/abstracts&gt;
  
  let $q3 :=
      cts:near-query(
        (
         cts:element-query((xs:QName("abstract_text")),
            cts:word-query( ("Controlled", "randomized", "randomised", "clinical", "masked","blind*","multi center", "open label*","compar*", "cross over", "placebo",
                  "post market","meta analysis","volunteer*", "prospective"
                  ),
            ("case-insensitive", "punctuation-insensitive", "wildcarded"))
          )
          ,
          cts:element-query((xs:QName("abstract_text")),
            cts:word-query(("stud*", "trial*" ),
            ("case-insensitive", "punctuation-insensitive", "wildcarded"))
          )
        ),   
         3
      )
  
  return 
    cts:highlight($xml,$q3, &lt;b&gt;{$cts:text}&lt;/b&gt;)
  </code></pre>
  
  <p>When I put the <code>NEAR</code> to <code>3</code> then it does not match <code>comparative</code> and <code>study</code> even though the distance is <code>3</code> and I have it <code>punctuation-insensitive</code>. But when I change it to <code>4</code> it works..  </p>
  
  <p>But when I also change to <code>punctuation-sensitive</code> even then with  <code>NEAR</code> distance to <code>3</code> still does not match . Why is that ?</p>
  
  <p>And also I want to achieve in the <code>word-query</code> to match say <code>placebo-controlled</code> and <code>placebo controlled</code>. which I think once I turn on the <code>punctuation-insensitive</code> and search for <code>placebo controlled</code> in my word query will find all combinations of the words.. But how will this effect the <code>NEAR</code> distance, when the same is used in the <code>NEAR</code> query ?</p>