[CWB] Refetching some concordances

Hardie, Andrew a.hardie at lancaster.ac.uk
Fri Apr 8 18:56:05 CEST 2011


Jan -- you might also be interested in how this works in CQPweb.

In concordance view, every result contains a hyperlink to extended context.

Example:

http://cqpweb.lancs.ac.uk/be2006/context.php?batch=3&qname=dej5zk6dhm&uT=y

The "qname" parameter is the name under which the query is saved. The "batch" parameter is the sequential number of the hit (ie the link above is for the fourth hit in the query result -- it's zero-indexed).

In the page that link points to, CQP is called as follows:

$cqp->execute("set Context $context_size words");
$data = $cqp->execute("cat $qname $batch $batch");

best

Andrew.


-----Original Message-----
From: cwb-bounces at sslmit.unibo.it [mailto:cwb-bounces at sslmit.unibo.it] On Behalf Of Serge Heiden
Sent: 08 April 2011 14:50
To: cwb at sslmit.unibo.it
Subject: Re: [CWB] Refetching some concordances

Hi Jan,

Why don't you just encode explicitely your word cpos id
into your words so that you can query them at anytime from inside CQP ?
It is a bit brute force practice, but can answer the
problem for small corpora.

Best,
Serge

le 08/04/2011 15:20 Selon Jan Jona Javorsek:
> Hello,
>
> I am having a similar problem, but in a different context.
>
> So there we go again: "Is there any way to refetch match using its cpos id?"
>
> I am listing reduced matches (in a web frontend) and I want to make it
> possible for the users to click on a match and refetch it with wider
> context (paragraph, for example).
>
> Without the reduce, one can reissue the query with approporate offset,
> but with reduce, I don't know how to do that without cpos.
>
> Thank you :-)
>
> -jan
>
>
> On 01/24/2011 03:10 PM, Alberto Simões wrote:
>> Thank you, Andrew
>>
>> Easy and Clean :)
>>
>> On 24/01/2011 12:24, Hardie, Andrew wrote:
>>> Since concordance hits can be more than one word you actually need
>>> (at least) two cpos's -- match and matchend. If you keep track of the
>>> match and matchend of your selected hits, those can be re-loaded to
>>> create a query that has just those selected hits in it (or just one
>>> hit if you like).
>>>
>>> You can use the CQP::undump method for this. Its documentation is
>>> fairly clear. I think the easiest way to go would be to ::dump your
>>> original query, edit the contents of the dump to match onkly the
>>> selected hits, (then save somewhere and reload another time... ) then
>>> ::undump when you need it again.
>>>
>>> Andrew.
>>>
>>> -----Original Message-----
>>> From: cwb-bounces at sslmit.unibo.it
>>> [mailto:cwb-bounces at sslmit.unibo.it] On Behalf Of Alberto Simões
>>> Sent: 24 January 2011 12:12
>>> To: Open source development of the Corpus WorkBench
>>> Subject: [CWB] Refetching some concordances
>>>
>>>
>>> Hello,
>>>
>>> Is there any way to refetch a concordance using its cpos id?
>>>
>>> That is: I need to let the user see a list (big list) of concordances,
>>> and select some. I need to save that list for future use. Isn't the cpos
>>> id enough?
>>>
>>> Thank you :)
>>>
>>> Alberto
>>
>
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://devel.sslmit.unibo.it/mailman/listinfo/cwb

-- 
Dr. Serge Heiden, slh at ens-lyon.fr, http://textometrie.ens-lyon.fr
ENS de Lyon/CNRS - ICAR UMR5191, Institut de Linguistique Française
15, parvis René Descartes 69342 Lyon BP7000 Cedex, tél. +33(0)622003883
_______________________________________________
CWB mailing list
CWB at sslmit.unibo.it
http://devel.sslmit.unibo.it/mailman/listinfo/cwb


More information about the CWB mailing list