registry: reset CORPUS_REGISTRY

Description Usage Arguments Details Value Examples

Description

A utility function to reset the environment variable CORPUS_REGISTRY. That may be necessary if you want use a CWB corpus that is not stored in the usual place. In particular, resetting the environment variable is required if you want to use a corpus delivered in a R package,

Usage

1
2
3
4
5
6
7

Arguments

registryDir

path to the registry directory to be used

corpus

the CWB name of the corpus

Details

Resetting the CORPUS_REGISTRY environment variable is achieved by unloading and reloading the C library 'rcqp' that is the backend for the rcqp package. It may not be the most artful way to do things, but it works.

To get the path to a package that contains a CWB corpus, use system.file.

Value

the registry directory used before resetting CORPUS_REGISTRY

Examples

1
2
3
4
5
6
7
8
## Not run: 
sampleCorpusPkgDir <- system.file(package="polmineR.sampleCorpus")
sampleCorpusRegistryDir <- file.path(sampleCorpusPkgDir, "extdata", "cwb", "registry")
oldRegistryDir <- resetRegistry(sampleCorpusRegistryDir)
sampleCorpusPartition <- partition("PLPRBTTXT", def=list(text_id=".*"), method="grep", verbose=F)
resetRegistry(oldRegistryDir)

## End(Not run)

nrauscher/corpus documentation built on May 23, 2019, 9:34 p.m.