Setting the CQP registry for rcqp.
cqi_getRegistry()
cqi_setRegistry(path)
(string) the full path of the registry directory.
cqi_getRegistry
returns a vector with the path of the registry
directory if it has been set, otherwise the NULL string.
cqi_setRegistry
does not return anything.
Corpora are declared in files located in a directory called
registry (see CWB documentation for more details). One of the
mechanisms provided by CWB in order to set the path of the registry
directory is to define the environment variable
CORPUS_REGISTRY
.
In rcqp
, the CORPUS_REGISTRY
environment variable is first
read. If it is not set, rcqp tries to use the default registry directory,
which varies according to your system (on most Unixes, it is
/usr/local/share/cwb/registry
; on Windows, it is
C:\CWB\Registry
). If this default directory does not exist, rcqp
cannot proceed further. At this point, you can use the
cqi_setRegistry
function to specify the path of the registry
directory.
The path passed to the cqi_setRegistry
function must exist. Note that,
once it is set, the path of the registry may not be changed.
In order to set the CORPUS_REGISTRY
variable, you can
either use the mechanisms provided by your system to set the environment variable before the R command is executed.
or define the variable from the R console using the
Sys.setenv
function. This must be done before the package
is loaded.
or define this variable in the configuration file
~/.Renviron
which is read by R at startup. In that case,
the environment variable is defined only for rcqp
, and will not be seen
by any other CWB program.
# NOT RUN {
Sys.setenv(CORPUS_REGISTRY="/users/vhugo/cwb/registry")
cqi_setRegistry("/users/vhugo/cwb/registry")
# }
Run the code above in your browser using DataLab