[CWB] Limit results of a search?

Thomas Zastrow thomas.zastrow at rzg.mpg.de
Mon Apr 7 09:42:46 CEST 2014


Am 05.04.2014 17:18, schrieb Stefan Evert:
>> Is there a way to limit the number of results I'll get back from CQP? I call it on the commandline with queries in a file ("-f") without a pager ("-p"). The result is straightforward analyzed, but for performance issues I want to limit the number of results which are created by CQP.
> There are various ways to limit the number of results.
>
> 1) You can append "cut N" to the query, which should (roughly) return the first N matches (not precise because of CQP's multi-pass query evaluation).
>
> 2) You can reduce a named query result to a random subset, e.g. "reduce A to N; " or "reduce A to x%;", where you've stored the query result under the name "A".  If you want this to be reproducible, don't forget to "randomize K;" with some seed value K beforehand.
>
> 3) You could only print the first N matches of the complete query result.  If it has been stored under the name "A", this can be done with "cat A 0 N-1;".  A similar syntax should work for output with the "tabulate" command.
>
> Best,
> Stefan

Dear Stefan,

Thanks a lot and greetings from Garching :-)

Tom


-- 
Dr. Thomas Zastrow
Rechenzentrum Garching (RZG) der Max-Planck-Gesellschaft / MPI für Plasmaphysik
Boltzmannstrasse 2, D-85748 Garching
Tel +49-89-3299-1457
http://www.rzg.mpg.de



More information about the CWB mailing list