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.
# S3 method for cqp_flist
print(x, ...) # S3 method for cqp_corpus
print(x, from = 0, to = 20, use_value = TRUE, ...)
# S3 method for cqp_subcorpus
print(x, positional.attribute = "word", from = 0, to = 10, ...)
# S3 method for 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=">> " ,="" ...)<="" p="">
# S3 method for cqp_attr
print(x, ...)
",>
An rcqp
object, created with cqp_flist
, corpus
, subcorpus
, cqp_kwic
, or $.cqp_corpus
.
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.
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 or id for a structural attribute with values.
Print each token of the subcorpus using the given positional attribute.
A function allowing a fine access to the way tokens are displayed in a concordance.
String inserted at the left of the keyword in a concordance.
String inserted at the right of the keyword in a concordance.
Ignored.
The print
command applied on a subcorpus object is a shortcut for :
k <- cqp_kwic(subcorpus) print(k)
Creating a cqp_kwic
object gives more control on the printing options.
corpus
,
subcorpus
,
cqp_kwic
,
cqp_flist
,
cqp_ftable
,
summary.cqp_flist
,
size.cqp_corpus
,
size.cqp_subcorpus
,
summary.cqp_corpus
,
summary.cqp_subcorpus
.
# NOT RUN {
c <- corpus("DICKENS");
c;
sc <- subcorpus(c, '"interesting"');
sc;
k <- cqp_kwic(sc);
k;
fl <- cqp_flist(c, "word");
fl;
# }
Run the code above in your browser using DataLab