Use CWB indexed corpora in R data packages by adding registry file to session registry.
use(pkg, corpus, lib.loc = .libPaths(), tmp = FALSE, verbose = TRUE)A logical value: TRUE if corpus has been loaded successfully, or
FALSE, if any kind of error occurred.
pkg is expected to be an installed data package that includes CWB indexed
corpora. The use()-function will add the registry files describing the
corpus (or the corpora) to the session registry directory and adjust the path
pointing to the data in the package.
The registry files within the package are assumed to be in the subdirectory './extdata/cwb/registry' of the installed package. The data directories for corpora are assumed to be in a subdirectory named after the corpus (lower case) in the package subdirectory './extdata/cwb/indexed_corpora/'. When adding a corpus to the registry, templates for formatting fulltext output are reloaded.
If the path to the data directory in a package includes a non-ASCII character, binary data files of the corpora in package are copied to a subdirectory of the per-session temporary data directory.
To get the temporary registry directory, see registry.
use("polmineR")
#> ✔ corpus loaded: GERMAPARLMINI (version: 0.1.0 | build date: 2023-04-16)
corpus()
#> corpus registry encoding type template size
#> 1 GERMAPARLMINI /tmp/RtmpZefqUA/polmineR_registry latin1 plpr TRUE 222201
#> 2 REUTERS /tmp/RtmpZefqUA/polmineR_registry latin1 <NA> TRUE 4050
#> 3 UNGA /tmp/RtmpZefqUA/polmineR_registry utf8 <NA> FALSE 127082