[CWB] cqi

Hardie, Andrew a.hardie at lancaster.ac.uk
Mon Oct 15 04:17:25 CEST 2012


>>> I'm interested to know if there is a place where are stored the ordered results of a query  like the results that are displayed on the command shell. But where the results of a query are stored after that are displayed in the command shell?

They are stored nowhere. As I explained, a query is a list of numbers. The concordance that you see printed out is generated from that list of numbers at the point in time when you print it out. It has no separate existence from the list of numbers in CQP’s memory. If you want to save the concordance, you have to save it yourself e.g. by redirecting the output of the cat command to a disk file.

>>> Can I save ordered results into my subcorpus after they are displayed in the shell? 

I don’t know what you mean by “save ordered results into my subcorpus”, in the sense that, it’s not clear to me what you mean by “subcorpus” here. Remember that in CQP, a subcorpus is exactly the same thing as a query: it’s a list of numbers defining a set of regions within the corpus.

best

Andrew.

PS You may not be aware you are doing this, but you have been sending your replies just to my email address and not to the list. Can we please keep the discussion on the list. Thanks.

=========================================================

From: drakan grass [mailto:luca_proc at yahoo.it] 
Sent: 14 October 2012 12:45
To: Hardie, Andrew
Subject: Re: [CWB] cqi

Thanks for the replies,

I'm interested to know if there is a place where are stored the ordered results of a query  like the results that are displayed on the command shell.
But where the results of a query are stored after that are displayed in the command shell?
Can I save ordered results into my subcorpus after they are displayed in the shell? 
Or  have I the same problem that the results are lists of numbers that indicate the positions of the hits That mean different things in different corpora?

best

________________________________________
Da: "Hardie, Andrew" <a.hardie at lancaster.ac.uk>
A: Drakan Grass <luca_proc at yahoo.it> 
Cc: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it> 
Inviato: Venerdì 5 Ottobre 2012 17:39
Oggetto: RE: [CWB] cqi

The result of a query via the CQi function CQI_CQP_QUERY (accessed via the method cqi_query() in the Perl module) is stored in the subcorpus named by second argument to that function, so you should not need to take any additional steps to avoid it being deleted....
 
USAGE:
$ok = cqi_query($corpus_to_search_in, $name_to_store_query_under, $the_query_itself);
 
You can’t append a query from one corpus to a query from another; it wouldn’t make sense to do so. Queries are, remember, lists of numbers that indicate the positions of the hits. The numbers mean different things in different corpora. So you can’t mix numbers from different corpora.
 
Appending one concordance to another is a rather higher-level task, if that’s what you mean. That would be much more easily done using the CWB:CQP module than via CQi.
 
best
 
Andrew.
 
From: Drakan Grass [mailto:luca_proc at yahoo.it] 
Sent: 05 October 2012 16:19
To: Hardie, Andrew
Subject: Re: [CWB] cqi
 
Thank's for your answers and for your availability!
 
I would know how works the CQI to try to understand if it's possible to save the results of a query before that the Last subcorpus is deleted and then maybe append the results of same query made ​​on a different corpus.
Which source code i must download over the perl module "CWB-Web Perl-CWB-CQI-3.0"?
 
Do you have some suggest for me?
 
________________________________________
Da: "Hardie, Andrew" <a.hardie at lancaster.ac.uk>
A: Drakan Grass <luca_proc at yahoo.it> 
Cc: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it> 
Inviato: Venerdì 5 Ottobre 2012 16:45
Oggetto: RE: [CWB] cqi
 
“Last” isn’t created by the Perl module. It’s created by the CQP server. Specifically, here:
 
http://cwb.svn.sourceforge.net/viewvc/cwb/cwb/trunk/cqp/parse_actions.c?revision=326&view=markup
 
Lines 269 to 242.
 
If I know what you’re trying to accomplish, I might be able to suggest a way to get it done...
 
best
 
Andrew.
 
From: Drakan Grass [mailto:luca_proc at yahoo.it] 
Sent: 05 October 2012 15:38
To: Hardie, Andrew
Subject: Re: [CWB] cqi
 
I'm trying to know how works cqi and i want know where in the perl code is created Last subcorpus.
 
I read in the Cqi tutorial : 
"CORPORA, SUBCORPORA, AND ATTRIBUTES
In the CQi, Corpus names are uppercase strings such as
BNC, HANSARD-EN, UP
 
Subcorpora names begin with a capital letter followed by zero or more lowercase characters (including digits
and hyphens). A full subcorpus identififier consists of both the name of the physical corpus and the subcorpus
name, separated by a colon:
BNC:A, UP:Last, HANSARD-EN:Collocations-1 .
Last is a special subcorpus, which contains the results of the last CQP query. It will be automatically
deleted whenever a new query is executed." 
 
________________________________________
Da: "Hardie, Andrew" <a.hardie at lancaster.ac.uk>
A: Drakan Grass <luca_proc at yahoo.it>; Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it> 
Inviato: Venerdì 5 Ottobre 2012 16:28
Oggetto: RE: [CWB] cqi
 
Hi,
 
I’m not sure I follow; can you explain what it is you’re trying to do?
 
best
 
Andrew.
 
From: cwb-bounces at sslmit.unibo.it [mailto:cwb-bounces at sslmit.unibo.it] On Behalf Of Drakan Grass
Sent: 05 October 2012 15:27
To: cwb at sslmit.unibo.it
Subject: [CWB] cqi
 
Dear all,
 
I read in the cqi's tutorial : "Last is a special subcorpus, which contains the results of the last CQP query. It will be automatically
deleted whenever a new query is executed."
I'm not a good perl programmer , anyway I saw in the source code"CWB-Web Perl-CWB-CQI-3.0" downloaded to the CWB's website looking for Last subcorpus, but I don't find it nowhere!
Anyone know when and where is created on the code the Last subcorpus? 
 
Best
 
 
 



More information about the CWB mailing list