Learn R Programming

rcqp (version 0.5)

cqp_registry: The CQP registry

Description

Setting the CQP registry for rcqp.

Usage

cqi_getRegistry()
	cqi_setRegistry(path)

Arguments

path

(string) the full path of the registry directory.

Value

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.

Details

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.

References

http://cwb.sourceforge.net/documentation.php

See Also

cqi_list_corpora, cqi_list_subcorpora, cqi_query.

Examples

Run this code
# 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