[CWB] Storing results for further search queries

Aleksandar Trklja aleksandar.trklja at univie.ac.at
Mon May 20 12:37:29 CEST 2019


Dear Stefan,

Many thanks for this. This is excellent - especially the option with the 
cwb-lexdecode command-line utility. I haven't used it that much so far.

Best
A

Am 18.05.2019 11:54, schrieb Stefan Evert:
>> Is there a way to save part of results as a variable and then to use 
>> it as a new query. For example after doing the following two steps in 
>> BNC:
>> 
>> 1. [hw="nice"] "to" [class="VERB"];
>> 2. count  Last  by  hw  on  matchend[0];
>> 
>> Can I somehow store only the list of words (e.g. as lemma forms) and 
>> then take that set as a search query?
> 
> That isn't possible, but you can achieve your goal with a bit of help
> from the Linux command-line.
> 
> 	A = [hw="nice"] "to" [class="VERB"];
> 	set PrettyPrint off;  # make output machine readable
> 	group A matchend hw;   # more efficient than count
> 
> You can now use the "cut" command-line utility to extract the list if
> verb lemmas from the frequency table.  This can be done from within
> CQP by redirecting output to a pipe:
> 
> 	group A matchend hw > "| cut -f1 > verbs.txt";
> 
> And then read in the wordlist:
> 
> 	define $verbs < "verbs.txt";
> 	B = [hw = $verbs & class = "VERB"]  # find all instances of a verb
> 
> If you just want the general lemma frequency, this can be obtained
> more efficiently with the cwb-lexdecode command-line utility  (but you
> should probably use the lemma attribute then so you only get the verb
> readings).
> 
> 	group A matchend hw > "| cut -f1 | cwb-lexdecode -P hw -f -F - BNC";
> 
> Best,
> Stefan
> 
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://liste.sslmit.unibo.it/mailman/listinfo/cwb

-- 
_Dr Aleksandar Trklja_
_Senior Lecturer_
_Department of Translation Studies_
_University of Vienna_


More information about the CWB mailing list