[CWB] export query to sql

Luigi Talamo luigi.talamo at unibg.it
Fri Apr 3 12:39:58 CEST 2015


Dear Stefan and Andrew,
thank you very much for your tutorial, that's what I was searching for.
And, of course, I will do my homework :-)

Best,
Luigi

2015-04-03 10:59 GMT+02:00 Stefan Evert <stefanML at collocations.de>:

> > tabulate A match word, match lemma;
> >
> > resulting in:
> >
> > word lemma
> > But how can I obtain the kwic in the first column, as in:
> >
> > kwic word lemma
>
> This sounds like you're searching for a single word.  In order to obtain
> sentence contexts, you can use the following trick:
>
>         set A target match;
>         B = A expand to s;
>         tabulate B match .. matchend word, target word, target lemma;
>
> The result is a TAB-delimited file with three columns where the first
> column contains the complete sentence context, with individual tokens
> separated by blanks.  If you want separate left and right context:
>
>         tabulate B match .. target[-1] word, target[1] .. matchend word,
> target word, target lemma;
>
> As Andrew has already pointed out, if you want a fixed number of context
> words, simply specify the desired offsets.  Again, you can put the entire
> context in a single column by specifying a range with .. (mnemonic for
> tabulate: every "," in the command gives you a TAB in the output).
>
>         tabulate A match[-5] .. match[-1] word, match[1] .. match[5],
> match word, match lemma;
>
> Exercise for the reader: modify this command so it works with matches of
> variable length.
>
> If you really wanted formatted kwic output as from "cat", simply "cat" the
> kwic lines into a text file, "tabulate" the other information into a second
> TAB-delimited file, then combine them with the "paste" program.
>
> Cheers,
> Stefan
> _______________________________________________
> CWB mailing list
> CWB at sslmit.unibo.it
> http://devel.sslmit.unibo.it/mailman/listinfo/cwb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://devel.sslmit.unibo.it/pipermail/cwb/attachments/20150403/700b2dea/attachment.html>


More information about the CWB mailing list