[CWB] Limit results of a search?
Stefan Evert
stefanML at collocations.de
Sat Apr 5 17:18:06 CEST 2014
> 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
More information about the CWB
mailing list