since manatee 2.28
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.
meet
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. In practise, the CQL above gives the same results as searching for any noun and then using a filter for the verb to be. However, the meet operator is faster than using filter.
union
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))
Operators meet and union cannot be used with operators within and containing.