> adj:[pos = "JJ.*"] ... ;
the label adj then refers to the corresponding token (i.e. its corpus position)
> adj:[pos = "ADJ."] :: adj < 500;
adjectives among the first 500 tokens
> [pos="DT"] a:[pos="JJ"]? [pos="NNS?"] :: a;
global constraint a is true iff match contains an adjective
> [pos="DT"] a:[]? [pos="NNS?"] :: a -> a.pos="JJ";
(-> is the logical implication operator , cf. Section 2.6)
> a:[] "and" b:[] :: a.word = b.word;
> a:[pos="PP"] []{0,5} b:[pos = "VB.*"]
:: b.pos = "VBZ" -> a.lemma = "he|she|it";
(this query ensures that the pronoun preceding a 3rd-person singular verb form is he, she or it; an additional constraint could exclude these pronouns for other verb forms)
> a:[] [pos = a.pos]{3};
sequences of four identical part-of-speech tags
_
)
instead to refer to the current corpus position
[_.pos = "NPS"]
[pos = "NPS"]
> [pos = "ADJ." & _ < 500];
such constraints are not allowed in query-initial position, so queries such as
[_ >= 666];
and [_ < 500 & pos = "ADJ."];
will be rejected as invalid
> [_ = 666];
can be used to look up a known corpus position efficiently
> a:[pos="DT"] [pos="JJ"]* b:[pos="NNS?"] :: distabs(a,b) >= 5;
simple NPs containing 6 or more tokens
> [pos="DT"] [pos="JJ"]* [pos="NNS?"] :: distabs(match, matchend) >= 5;
> [word = ".*ment" & strlen(word) >= 16];
>
, >=
, <
, <=
) are only
allowed for integers (corpus positions, string lengths, etc.), but not for strings
and regular expressions; CQP versions before v3.4.17 used to silently accept and
misinterpret such inequality comparisons