cqi_dump_subcorpus: Handle subcorpora

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/main.R

Description

Get size and corpus positions corresponding to the results of a query.

Usage

1
2
3

Arguments

subcorpus

(string) qualified name of a subcorpus.

first

(integer) first index. Optional: default is 0.

last

(integer) last index. Optional: default is size-1.

Details

A subcorpus is typically the result of a previous query (see the cqi_query function). The qualified name of the subcorpus is of the form name_of_corpus:name_of_subcorpus, for instance "DICKENS:A". The name of the subcorpus is declared in the second argument of the cqi_query function.

The cqi_dump_subcorpus function builds a two-dimension array (a matrix) of corpus positions corresponding to the results of a query.

The cqi_drop_subcorpus function frees the memory allocated to a subcorpus.

Value

cqi_subcorpus_size returns an integer which is the number of matches in the specified subcorpus.

cqi_dump_subcorpus returns a matrix with four columns corresponding to the match, matchend, target, and keyword fields respectively. Each row corresponds to a query match. The number of rows is last-first+1. This is the size of the subcorpus if the first and last arguments are not specified.

cqi_drop_subcorpus does not return anything.

Author(s)

Bernard Desgraupes - bernard.desgraupes@u-paris10.fr - University Paris-10.
Sylvain Loiseau - sylvain.loiseau@univ-paris13.fr - University Paris-13.

References

http://cwb.sourceforge.net/documentation.php

See Also

cqi_query, cqi_list_corpora, cqi_list_subcorpora.

Examples

1
2
3
4
5
6
7
## Not run: 
cqi_query("DICKENS","Foo","\"interesting\";")
cqi_subcorpus_size("DICKENS:Foo")
cqi_dump_subcorpus("DICKENS:Foo")
cqi_dump_subcorpus("DICKENS:Foo",4,10)

## End(Not run)

rcqp documentation built on March 18, 2018, 1:54 p.m.