[CWB] Search list

Stefan Evert stefanML at collocations.de
Fri Mar 27 09:18:36 CET 2015


> I would like to search several multi-word expressions in my corpus and I was wondering if it is possible to create a search list directly in CWB or to run a Grep command within CWB? Thanks!

You can't read a list of multiword expressions into CQP and search for them – that's only possible with lists of single words.

For a given list, you can design a CQP query that finds all expressions in the list, e.g.

	"in"%c "that"%c "regard"%c | "in"%c "any"%c "event"%c | "in"%c "those"%c "circumstances"%c | "the"%c "fact"%c "that"%c | "as"%c "regards"%c "the"%c | "on"%c "the"%c "contrary"%c;

This probably won't work if you have a list of several hundred multiwords, though I don't know the precise limits off the top of my head.  There might be tighter limits if you enter this in an interactive session (with -e flag) because the entire input line is read into an editing buffer first.

You can speed this up a little and push the limits if you combine expressions with the same prefix, in this case

	"in"%c ("that"%c "regard"%c | "any"%c "event"%c | "those"%c "circumstances"%c) | "the"%c "fact"%c "that"%c | "as"%c "regards"%c "the"%c | "on"%c "the"%c "contrary"%c;

I'd recommend that you generate such queries in Perl or some other high-level language.

Hope this helps,
Stefan



More information about the CWB mailing list