since manatee 2.84

Using Word Sketch data in CQL

Concordances generated form Word Sketch data, i.e. those containing collocations, can be used in CQL. To generate such a concordance, use this syntax:

[ws(headword,relation,collocation)]

Relations

Relation is the name of the relation as it appears in the header of the column on the word sketch screen. You can often guess the name by using a regular expression like this:

".*subject.*"

For the exact name of the relation, please refer to the word sketch screen. The headword should be exchanged for "%w", respective \"%w\" as the quotes need to be backslashed in CQL. For example, the Word Sketch relation modifiers of "book" can be written as a CQL query

[ws("book-n", "modifiers of \"%w\"", ".*")]

and the relation  "book" and/or ... will become

[ws("book-n", "\"%w\" and/or \.\.\.", ".*")]

(again, dots need to be backslashed).

Remember that Word Sketches are generated from lempos, so it is necessary to use a hyphen and the shortened PoS tag. For example to generate a concordance with test (as a noun) being the object of conduct (as a verb), use this:

[ws("test-n",".*object.*","conduct-v")]

A regular expression can be used for all three values.

Specifying the headword

In the resulting concordance, the headword is taken for a KWIC and the collocations are used as a filter. It is possible to specify the headword by using the regular expression AND inside the square brackets. For example, to search for all relations of lempos ‘book-n’ where the word appears in the plural form, you can use a CQL query:

[ws("book-n", ".*", ".*") & tag="NNS"]

Prepositional phrases

The prepositional phrases can be searched by the following syntax:

[ws("headword", "\.\.\. [^ /]+ \"%w\"", ".*") | ws("headword", "\"%w\" [^ /]+ \.\.\.", ".*")]

In case only specific prepositions should be displayed, it is possible to insert them instead of [^ /]. This example will find concordance lines with the headword ‘test’ as a noun and prepositions of, in, or at:

[ws("test-n", "\.\.\. (of|in|at) \"%w\"", ".*") | ws("test-n", "\"%w\" (of|in|at) \.\.\.", ".*")]

Combinations with other CQL

The Word Sketch CQL can be combined with other CQL markers. To generate a concordance where the headword test is modified by blood and followed or preceded by the lemma be, use this:

(meet [ws("test-n",".*modifiers of.*","blood-n")] [lemma="be"] -1 1)