Searching the left and right context
Searching the left and right context at the same time is only possible with these operators. The standard CQL only allows searching the left context or the right context but not both at the same time.
Use meet to set the left and right context.
This will find all nouns which have the verb to be 3 tokens to the left or 3 tokens to the right:
(meet [tag = "N.*"] [tag = "VB.*"] -3 3)
Only the first part, i.e. [tag="N.*"], is highlighted as KWIC in the concordance, the [tag="VB.*"] is used as a filter.
Use the operator union to collect the results of two meet queries and display them in one concordance.
This CQL will:
- find all nouns with the verb to be at a distance of 3 tokens to the left or right
- find all adjectives with the verb to be at a distance of 2 tokens to the left or right
- combine the nouns from the first query and adjectives from the second query and display them together in one concordance, the nouns and adjectives will be highlighted in the centre as KWIC
Note that each meet as well as union have to be inside its own pair of brackets.
(union (meet [tag="N.*"] [tag="VB.*"] -3 3) (meet [tag="A.*"] [tag="VB.*"] -2 2))
This combines instances of nouns preceded by competent with adjectives followed by competence:
(union(meet [tag="N.*"] [lemma="competent"] -2 -1)(meet [tag="J.*"] [lemma="competence"] 1 2))
Both meet and union may occur wherever a positional attribute is required (where a pair of square brackets is required) and can be combined with within/containing queries.
< s/> containing (meet [lemma="have"] [tag="P.*"] -3 5) containing (meet [tag="N.*"] [lemma="blue"] -4 2)