<div dir="ltr">Dear Andrew and Stefan,<div>thank you very much for your helpful answers.</div><div>Stefan, your two solutions work both well. What do you exactly mean with the &quot;within&quot; clause to add to the query?</div>
<div>Thank you very much,</div><div>Leontyna</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/11 Stefan Evert <span dir="ltr">&lt;<a href="mailto:stefanML@collocations.de" target="_blank">stefanML@collocations.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11 Apr 2013, at 16:18, &quot;Hardie, Andrew&quot; &lt;<a href="mailto:a.hardie@lancaster.ac.uk">a.hardie@lancaster.ac.uk</a>&gt; wrote:<br>

<br>
&gt; Subcorpus = &lt;p_monthstudy=&quot;[1-7]&quot;&gt;[]*&lt;/p_monthstudy&gt;;<br>
&gt; Subcorpus;<br>
<br>
</div>For technical reasons, it&#39;s better to use this form:<br>
<br>
        Subcorpus = &lt;p_monthstudy=&quot;[1-7]&quot;&gt;[] expand to p_monthstudy;<br>
        Subcorpus;<br>
<br>
otherwise you&#39;ll lose all longer paragraphs (containing more than 100 tokens); on a large corpus, this form will also be substantially faster.<br>
<br>
If you don&#39;t mind a loss of efficiency, you can run the query on the full corpus and post-filter your results with a global constraint.  Note that if you&#39;re not confident about working out the correct regular expressions to match single- and double-digit months correctly, you can use numeric comparisons in this second version.  Perform this without activating a subcorpus:<br>

<br>
        ... your query ... :: int(match.p_monthstudy) &gt;= 1 &amp; int(match.p_monthstudy) &lt;= 7;<br>
<br>
You should perhaps add a &quot;within&quot; clause to the query to make sure that the entire match is within a single paragraph, otherwise it&#39;s not very sensible to filter on the p_monthstudy attribute.<br>
<br>
Hope this hilft,<br>
Stefan<br>
<br>
<br>
<br>
_______________________________________________<br>
CWB mailing list<br>
<a href="mailto:CWB@sslmit.unibo.it">CWB@sslmit.unibo.it</a><br>
<a href="http://devel.sslmit.unibo.it/mailman/listinfo/cwb" target="_blank">http://devel.sslmit.unibo.it/mailman/listinfo/cwb</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Leontyna Bratankova
</div>