<div dir="ltr">Thank you for your answer, Stephanie! It makes sense now.<br>Cheers!<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>--</div><div><div>José Manuel Martínez Martínez</div><div><a href="https://chozelinek.github.io" target="_blank">https://chozelinek.github.io</a></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 31, 2022 at 7:51 PM Stephanie Evert <<a href="mailto:stefanML@collocations.de">stefanML@collocations.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> I have a corpus for which each sentence we have an structural attribute s_lsent_linguistic_features that can have a value from 0 to 1.<br>
> I want to filter the sentences with a value lower than 0.3.<br>
> I've seen in the documentation that one can use the int built-in function to make comparisons with values that should be interpreted as numbers.<br>
> I'm using something like this<br>
> <s>[_.s_sent_quality_score = "0\.[1|2|3].*"]<br>
> But I was wondering, whether using the int built-in function it could be written in a better/easier way.<br>
<br>
Not directly: int() does exactly what its name says and converts the annotated string to an integer if possible. In this case, you'll probably always get a 0 result.<br>
<br>
However, you could convert your annotations to fixed-point representation, e.g. multiply by 1000 and round to integer for three decimal digits of precision. So e.g. 0.3 would be stored as the string "300" in your s-attribute.<br>
<br>
Then your query translates to<br>
<br>
<s> [int(_.s_sent_quality_score) >= 100 & int(_.s_sent_quality_score) < 400]<br>
<br>
Best,<br>
Stephanie<br>
<br>
</blockquote></div>