A set of functions to check whether the input values to the Rcpp wrappers for the C functions of the Corpus Workbench potentially causing crashes are valid. These auxiliary functions are called by the cl_ and cqp_ functions.
check_registry(registry)
check_corpus(corpus, registry, cl = TRUE, cqp = TRUE)
check_s_attribute(
s_attribute,
corpus,
registry = Sys.getenv("CORPUS_REGISTRY")
)
check_p_attribute(
p_attribute,
corpus,
registry = Sys.getenv("CORPUS_REGISTRY")
)
check_strucs(corpus, s_attribute, strucs, registry)
check_region_matrix(region_matrix)
check_query(query)
check_cpos(
corpus,
p_attribute = "word",
cpos,
registry = Sys.getenv("CORPUS_REGISTRY")
)
check_id(corpus, p_attribute, id, registry = Sys.getenv("CORPUS_REGISTRY"))
path to registry directory
name of a CWB corpus
A logical
value, whether CL availability of corpus is required
for positive result.
A logical
value, whether CQP availability of corpus is required
for positive result.
a structural attribute
a positional attribute
strucs (indices of structural attributes)
a region matrix
a CQP query
vector of corpus positions
id (encoded p-attribute), integer value