[CWB] query parallel corpus from command line

Stefan Evert stefanML at collocations.de
Mon Nov 20 18:03:09 CET 2017


Hi Andrés!

> cqp -I init.fl -r registry/ -D CORPUS_OL -f search.fl > results.txt


First, I'd suggest to experiment in an interactive CQP session to get it to work there (because you can try different combinations of settings), and then put the commands it into script files.

> CORPUS_OL : corpus origin language
> CORPUS_TL : corpus target language
> Both corpus has been indexed and aligned.

Assuming that the corpora are properly aligned, you should have an alignment attribute corpus_tl in CORPUS_OL.

> On 20 Nov 2017, at 16:10, Andrés Chandía <andres at chandia.net> wrote:
> 
> set lc 25 ;
> set rc 25 ;

	set Context s;

might make more sense if you're displaying the aligned regions.

> show +pos +lemma;
> show +s;

What you're missing is to activate the alignment:

	show +corpus_tl;

Running a query like

	[word = "Frau"] cut 10;

should now display the aligned region for each query hit.  This may be confusing if the source region doesn't correspond to a single sentence.  In current versions of CQP, you can use a hack to display the actual alignment beads:

	set Context corpus_tl;

Does this help?

Best,
Stefan



More information about the CWB mailing list