Learn R Programming

rcqp (version 0.5)

cqi_query: Query an indexed corpus

Description

The cqi_query function executes a query on the specified corpus. The query syntax is described in the CQP Query Language Tutorial (see below).

Usage

cqi_query(mother, child, query)

Arguments

mother

(string) the name of the corpus.

child

(string) the name given to the subcorpus which will contain the results of the query.

query

(string) the query string.

Value

cqi_query does not return anything. In order to manipulate the results, one must invoke the cqi_dump_subcorpus function.

Details

The query string must be properly quoted in order to be syntactically correct when it is passed to the CQP interpreter.

The name of a corpus is always written in uppercase letters. The name of a subcorpus must start with an uppercase letter and can contain both uppercase and lowercase letters, underscores, dashes and digits.

References

See Also

cqi_dump_subcorpus, cqi_drop_subcorpus, cqi_attributes, cqi_attribute_size.

subcorpus, corpus.

Conversion functions: cqi_alg2cpos, cqi_cpos2alg, cqi_cpos2id, cqi_cpos2lbound, cqi_cpos2rbound, cqi_cpos2str, cqi_cpos2struc, cqi_id2cpos, cqi_id2freq, cqi_id2str, cqi_regex2id, cqi_str2id, cqi_struc2cpos, cqi_struc2str.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
cqi_query("DICKENS","Foo","\"eas(y|ier|iest)\";")
cqi_dump_subcorpus("DICKENS:Foo",0,10)
cqi_drop_subcorpus("DICKENS:Foo")

cqi_query("DICKENS","Go","[lemma=\"go\"] \"and\" [];")
cqi_dump_subcorpus("DICKENS:Go",0,10)
cqi_drop_subcorpus("DICKENS:Go")

cqi_query("DICKENS","NP","[pos=\"DT\"] @[pos=\"JJ\"]? [pos=\"NNS?\"];")
cqi_dump_subcorpus("DICKENS:NP",0,10)
cqi_drop_subcorpus("DICKENS:NP")
# }

Run the code above in your browser using DataLab