[CWB] cqpweb question

Stephanie Evert stefanML at collocations.de
Wed Apr 8 09:00:16 CEST 2026


Hi Graham,

your query is already almost what you want, you just have to drop the restriction to the single lemma "laugh".

	n1:[pos="VV."] []{1,3} n2:[pos="NN."] :: n1.hw=n2.hw

Mind you, this will be slow as it has to check every possible verb-noun combination and test whether the two lemmas happen to be identical.

Labels like n1 and n2 can only be attached to token descriptions and reference a corpus position, so you can't just store the value of n1.hw and use it for the comparison later. But in most cases, this is not a major limitation.

Alternative version of the query:

	n1:[pos="VV."] []{1,3} [hw=n1.hw & pos="NN."] 

I prefer your version with the global constraint, though, because I find it easier to read.

Best,
Stephanie

> On 7 Apr 2026, at 08:22, Graham Ranger -- UAPV via CWB <cwb at sslmit.unibo.it> wrote:
> 
> Hello to all,
> This question concerns the cqp syntax available on the cqpweb interface.
> I'm trying to look for constructions including cognate objects. This:
> 
> n1:[hw="laugh" & pos="VV."] []{1,3} n2:[hw="laugh" & pos="NN."]::n1.hw=n2.hw
> 
> will work to give me things like "He laughed a mirthless laugh", which is good.
> What I'd really like, though, is to be able to define a variable for the first hw which coincides with the variable for the second hw, in order to get things like "Lucy smiled a small tight-fisted smile", "Jamie grins his tired grin", etc. I've tried with [] and n1 n2::n1=n2, and with regular expressions, working on word and  pos as well as hw and trying to match partial strings, but either I'm missing something or cqpweb does not allow this sort of query.
> Any help would as always be very much appreciated!
> Best wishes,
> Graham.
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://liste.sslmit.unibo.it/mailman/listinfo/cwb

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20260408/3ec67e53/attachment-0001.html>


More information about the CWB mailing list