s_attr_regions: Get regions defined by a structural attribute

View source: R/decode.R

s_attr_regionsR Documentation

Get regions defined by a structural attribute

Description

Get all regions defined by a structural attribute. Unlike get_region_matrix() that returns a region matrix for a defined subset of strucs, all regions are returned. As it is the fastest option, the function reads the binary *.rng file for the structural attribute directly. The corpus library (CL) is not used in this case.

Usage

s_attr_regions(
  corpus,
  s_attr,
  registry = Sys.getenv("CORPUS_REGISTRY"),
  data_dir = corpus_data_dir(corpus = corpus, registry = registry)
)

Arguments

corpus

A length-one character vector with a corpus ID.

s_attr

A length-one character vector stating a structural attribute.

registry

A length-one character vector stating the registry directory (defaults to CORPUS_REGISTRY environment variable).

data_dir

The data directory of the corpus.

Value

A two-colum matrix with the regions defined by the structural attribute: Column 1 defines left corpus positions and column 2 right corpus positions of regions.

Examples

s_attr_regions("REUTERS", s_attr = "id", registry = get_tmp_registry())

RcppCWB documentation built on Sept. 24, 2024, 1:08 a.m.