[CWB] Strange problem with a query
Stefan Evert
stefanML at collocations.de
Tue Jul 24 18:55:58 CEST 2012
>>>> [pos="VV.*"][pos="DT."]? [pos="AV0"]? [pos="AJ.*"]* [pos="N.*"] [pos="AJ.*"][(pos="N.*")|(pos="PR.*")|(pos="TO0")]! within s;
>> Why did you put the exclamation mark if you're not running a subquery?
>
> OK, I thought '!' was the boolean operator for NOT.
It is, but you put it in the wrong place. Outside the [...] you can only use regular expression operators, which don't include negation. Inside the [...], you can use "!" to negate a Boolean expression. What you wanted is
> [!(pos="N.*" | pos="PR.*" | pos="TO0")]
which is indeed equivalent to
> [(pos!="N.*")&(pos!="PR.*")&(pos!="TO0")]
I suppose the fastest and most elegant version would be
> [pos != "N.*|PR.*|TO0"]
Best,
Stefan
More information about the CWB
mailing list