Get s-attributes.
Structural annotations (s-attributes) of a corpus capture metainformation for
regions of tokens. The s_attributes
-method offers high-level access to
the s-attributes present in a corpus
or subcorpus
, or the values of
s-attributes in a corpus
/partition
.
s_attributes(.Object, ...) ## S4 method for signature 'character' s_attributes(.Object, s_attribute = NULL, unique = TRUE, regex = NULL, ...) ## S4 method for signature 'corpus' s_attributes(.Object, s_attribute = NULL, unique = TRUE, regex = NULL, ...) ## S4 method for signature 'slice' s_attributes(.Object, s_attribute = NULL, unique = TRUE, ...) ## S4 method for signature 'partition' s_attributes(.Object, s_attribute = NULL, unique = TRUE, ...) ## S4 method for signature 'subcorpus' s_attributes(.Object, s_attribute = NULL, unique = TRUE, ...) ## S4 method for signature 'call' s_attributes(.Object, corpus) ## S4 method for signature 'remote_corpus' s_attributes(.Object, ...) ## S4 method for signature 'remote_partition' s_attributes(.Object, ...)
.Object |
A |
... |
To maintain backward compatibility, if argument |
s_attribute |
The name of a specific s-attribute. |
unique |
A |
regex |
A regular expression passed into |
corpus |
A |
Importing XML into the Corpus Workbench (CWB) turns elements and element
attributes into so-called "s-attributes". There are two basic uses of the
s_attributes
-method: If the argument s_attribute
is NULL
(default), the return value is a character
vector with all
s-attributes present in a corpus.
If s_attribute
is the name of a specific s-attribute (a length-one
character vector), the values of the s-attributes available in the
corpus
/partition
are returned.
If argument unique
is FALSE
, the full sequence of the
s_attributes is returned, which is a useful building block for decoding a
corpus.
If argument s_attributes
is a character providing several s-attributes, the method
will return a data.table
. If unique
is TRUE
, all unique
combinations of the s-attributes will be reported by the data.table
.
If .Object
is a call, the s_attributes
-method will
return a character vector with the s-attributes occurring in the call. This
usage is relevant internally to implement the subset
method to
generate a subcorpus
using non-standard evaluation. Usually it will
not be relevant in an interactive session.
A character vector (s-attributes, or values of s-attributes).
use("polmineR") s_attributes("GERMAPARLMINI") s_attributes("GERMAPARLMINI", "date") # dates of plenary meetings s_attributes("GERMAPARLMINI", s_attribute = c("date", "party")) s_attributes(corpus("GERMAPARLMINI")) p <- partition("GERMAPARLMINI", date = "2009-11-10") s_attributes(p) s_attributes(p, "speaker") # get names of speakers # Get s-attributes occurring in a call s_attributes(quote(grep("Merkel", speaker)), corpus = "GERMAPARLMINI") s_attributes(quote(speaker == "Angela Merkel"), corpus = "GERMAPARLMINI") s_attributes(quote(speaker != "Angela Merkel"), corpus = "GERMAPARLMINI") s_attributes( quote(speaker == "Angela Merkel" & date == "2009-10-28"), corpus = "GERMAPARLMINI" )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.