print: Print a CWB object

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

Description

Print a CWB object in an exhaustive way. A cqp_flist object is printed just as an integer vector; a corpus is printed as a dataframe where rows represent tokens and columns represent attributes (positional as well as structural); a subcorpus is printed as a cqp_kwic list (or concordance); a cqp_kwic object is printed... as expected.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 ## S3 method for class 'cqp_flist'
print(x, ...)

 ## S3 method for class 'cqp_corpus'
print(x, from = 0, to = 20, use_value = TRUE, ...)

 ## S3 method for class 'cqp_subcorpus'
print(x, positional.attribute = "word", from = 0, to = 10, ...)

 ## S3 method for class 'cqp_kwic'
print(x, from = 0, to = min(20, nrow(x)-1), 
        print_tokens = function(x, cpos) cqi_cpos2str(
		paste(attr(x, "parent.cqp_corpus.name"),"word", sep = "."), cpos), 
		left.separator = " <<", right.separator = ">> ", ...)

 ## S3 method for class 'cqp_attr'
print(x, ...)

Arguments

x

An rcqp object, created with cqp_flist, corpus, subcorpus, cqp_kwic, or $.cqp_corpus.

from

Select first tokens (for a corpus object) or matches (for a subcorpus or cqp_kwic object) to be printed. As for all CWB data, this index is 0-based.

to

Select last tokens (for a corpus object) or matches (for a subcorpus or cqp_kwic object) to be printed. As for all CWB data, this index is 0-based.

use_value

use value or id for a structural attribute with values.

positional.attribute

Print each token of the subcorpus using the given positional attribute.

print_tokens

A function allowing a fine access to the way tokens are displayed in a concordance.

left.separator

String inserted at the left of the keyword in a concordance.

right.separator

String inserted at the right of the keyword in a concordance.

...

Ignored.

Details

The print command applied on a subcorpus object is a shortcut for :

1
2

Creating a cqp_kwic object gives more control on the printing options.

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

corpus, subcorpus, cqp_kwic, cqp_flist, cqp_ftable, summary.cqp_flist, size.cqp_corpus, size.cqp_subcorpus, summary.cqp_corpus, summary.cqp_subcorpus.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
c <- corpus("DICKENS");
c;

sc <- subcorpus(c, '"interesting"');
sc;

k <- cqp_kwic(sc);
k;

fl <- cqp_flist(c, "word");
fl;


## End(Not run)

PolMine/rcqp.mac documentation built on May 28, 2019, 2:24 p.m.