Get terms in partition or corpus.

# S4 method for class 'partition'
terms(x, p_attribute, regex = NULL)

# S4 method for class 'subcorpus'
terms(x, p_attribute, regex = NULL)

# S4 method for class 'corpus'
terms(x, p_attribute, regex = NULL, robust = FALSE)

# S4 method for class 'character'
terms(x, p_attribute, regex = NULL, robust = FALSE)

Arguments

x

A corpus, partition or subcorpus object, or a length-one character with a corpus id.

p_attribute

The p-attribute to for which to retrieve results (length-one character vector).

regex

Regular expression(s) to filter results (character vector).

robust

A logical value, whether to check for potential failures.

Examples

use(pkg = "RcppCWB", corpus = "REUTERS")
#> ✔ corpus loaded: REUTERS

r <- partition("REUTERS", id = "144")
#> ... get cpos and strucs
words <- terms(r, "word")
terms(r, p_attribute = "word", regex = ".*il.*")
#> [1] "oil"     "ability" "will"    "April"   "Dillard"