Learn R Programming

polmineR (version 0.7.11)

corpus-class: S4 class to wrap information on CWB corpora.

Description

S4 class to wrap information on CWB corpora.

Usage

# S4 method for corpus
$(x, name)

# S4 method for corpus,ANY ==(e1, e2)

# S4 method for corpus,ANY !=(e1, e2)

# S4 method for corpus %in%(x, table)

# S4 method for corpus zoom(x, ...)

Arguments

x

A corpus object.

name

An s-attribute that will be assigned as key to a partition.

e1

A first expression, a partition object in this case.

e2

A second expression, the value of an s-attribute.

table

Values a s-attribute shall assume.

...

Further arguments.

Slots

corpus

A length-one character vector, a CWB corpus.

data_dir

The directory where the files for the indexed corpus are.

type

The type of the corpus (e.g. "plpr" for a corpus of plenary protocols).

encoding

The encoding of the corpus, given as a length-one character vector.

key

A length-one character vector stating a s-attribute that serves as a key.

Details

The `$`-method will assign the argument name to the slot key and return the modified object.

See Also

Other classes to manage corpora: regions, subcorpus-class

Examples

Run this code
# NOT RUN {
corp <- corpus("GERMAPARLMINI")
corp2 <- corp$speaker
corp2@key
x <- corpus("GERMAPARLMINI")
x$date == "2009-10-28"
x <- corpus("GERMAPARLMINI")
x$party != "NA"
x <- corpus("GERMAPARLMINI")
x$date %in% c("2009-10-27", "2009-10-28")
x <- corpus("GERMAPARLMINI")
y <- zoom(x, date == "2009-10-28")

x <- partition("GERMAPARLMINI", interjection = "speech")
m <- zoom(x, date == "2009-10-28" & speaker == "Angela Dorothea Merkel")

not_unknown <- zoom(x, party != c("NA", "FDP"))
s_attributes(not_unknown, "party")
# }

Run the code above in your browser using DataLab