Learn R Programming

polmineR (version 0.7.0)

sAttributes,character-method: Get s-attributes.

Description

Structural annotations (s-attributes) of a corpus provide metainformation for ranges of text. Importing XML into the Corpus Workbench (CWB) turns elements and element attributes into s-attributes. There are two uses of the sAttributes-method: If the sAttribute parameter is NULL (default), the return value is a character vector with all s-attributes. If sAttribute is the name of a specific s-attribute (i.e. a length 1 character vector), the respective s-attributes available in the corpus are returned.

Usage

"sAttributes"(.Object, sAttribute = NULL, unique = TRUE, regex = NULL)
"sAttributes"(.Object, sAttribute = NULL)

Arguments

.Object
either a partition or a character vector specifying a CWB corpus
sAttribute
name of a specific s-attribute
unique
logical, whether to return unique values only
regex
filter return value by applying a regex

Value

a character vector

Examples

Run this code
## Not run: 
#   use("polmineR.sampleCorpus")
#   
#   sAttributes("PLPRBTTXT")
#   sAttributes("PLPRBTTXT", "text_date") # dates of plenary meetings
#   
#   P <- partition("PLPRBTTXT", text_date = "2009-11-10")
#   sAttributes(P)
#   sAttributes(P, "text_name") # get names of speakers
# ## End(Not run)

Run the code above in your browser using DataLab