[CWB] cqi

Hardie, Andrew a.hardie at lancaster.ac.uk
Mon Oct 15 13:31:55 CEST 2012


>> Can you tell me please which are the parts of code that enable this transformation in CQP and in the CQI perl module?

The CQi function that does this is cqi_cpos2str().

You tell this function what attribute you want, and give it an array of integer corpus positions. It returns the value of that attribute at each of the specified positions. Obviously, you then have to build up the concordance yourself from those return values. This is pretty low-level, and not he recommended way to go about things.

The code in CQP that creates concordance outputs is spread across numerous files: concordance.c, output.c, ascii_print.c etc.

If what you want is to get a concordance into memory so you can manipulate it later, the easiest way to do it is to use the CWB::CQP module. When you use that module to access CQP, print-outs of concordances are returned to the caller.

best

Andrew.


From: cwb-bounces at sslmit.unibo.it [mailto:cwb-bounces at sslmit.unibo.it] On Behalf Of Drakan Grass
Sent: 15 October 2012 12:16
To: Open source development of the Corpus WorkBench
Subject: Re: [CWB] cqi

Thanks for the replies,

>>>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.

I understand "They are stored anywhere", but where are the parts of code that transform the list of numers in the results as I see it displayed on the command shell?
Can you tell me please which are the parts of code that enable this transformation in CQP and in the CQI perl module?

>>>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.

When I said "my subcorpus", I wronged but I meant a file or a structure where I can copy the results of a query, as I see it displayed in the command shell .

Best

PS   I'm sorry,  I forgot to send my last email at the mailing list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://devel.sslmit.unibo.it/pipermail/cwb/attachments/20121015/7a8212b4/attachment.html>


More information about the CWB mailing list