- store query result in memory under specified name (should begin with capital letter)
> Go = [lemma = "go"] "and" [];
note that query results are not automatically displayed in this case
- list named query results (or NQR for short)
> show named;
- the NQR specifiers shown in the output of this command are fully
qualified with the CWB name of the corpus, e.g. DICKENS:Go for the
query above. As a consequence, there can be multiple NQRs with the same name
for different corpora.
- if NQR names are used without a prefixed corpus in CQP commands
(as in the examples below), they are automatically prefixed
with the currently activated corpus
- the result of the most recent (last) query is automatically stored
in memory and named Last
- commands such as cat, sort, and count operate on
Last by default
- Last is always temporary and will be overwritten
when a new query is executed (or a subset
command, see Section 3.5)
- display number of results
> size Go;
- (full or partial) KWIC display
> cat Go;
> cat Go 5 9;
(6
– 10
match)
- sorting a named query result automatically re-displays the matches
> sort Go by word %cd;
- the count command also sorts the named query on which it
operates, that is,
> count Go by lemma cut 5;
implicitly executes the command sort Go by lemma;
- this has the advantage that identical word sequences now appear on
adjacent lines in the KWIC display and can easily be printed with a single
cat command; the respective line numbers are shown in square
brackets at the end of each line in the frequency listing
13 go and see [#128-#140]
10 go and sit [#144-#153]
9 go and do [#29-#37]
7 go and fetch [#42-#48]
7 go and look [#87-#93]
7 go and play [#107-#113]
to display occurrences of go and see, enter
> cat Go 128 140;
- if a fully qualified NQR is used, a query result can be accessed even if
its corpus isn't currently activated, so that
> size DICKENS:Go;
> count DICKENS:Go by lemma cut 5;
will work regardless of the current corpus.
- Due to a long-standing bug in CQP, this feature should not be used with
cat or any other command that generates KWIC output (such as
sort). Doing so will corrupt the context descriptor, which holds
information about all available attributes, those selected for printing, and
the KWIC context size.
> GERMAN-LAW;
> show cd;
> cat DICKENS:Time;
> show cd;
- The context descriptor can only be repaired by temporarily activating a
different corpus and then re-activating the desired corpus.
> DICKENS;
> GERMAN-LAW;