CQP needs to know where to look for CWB indexed corpora. To initialize CQP, call cqp_initialize. To reset the registry, use the function cqp_reset_registry. To get the registry used by CQP, use cqp_get_registry. To get the initialization status, use cqp_is_initialized

cqp_initialize(registry = Sys.getenv("CORPUS_REGISTRY"))

cqp_is_initialized()

cqp_verbosity(silent, verbose)

cqp_get_registry()

cqp_reset_registry(registry = Sys.getenv("CORPUS_REGISTRY"))

cqp_load_corpus(corpus, registry)

Arguments

registry

the registry directory

silent

A single logical value, whether to be silent and suppress CQP messages (TRUE), or not (FALSE).

verbose

A single logical value, whether to show verbose parser output (TRUE) or not (FALSE).

corpus

ID of a CWB corpus (length-one character).

Details

cqp_load_corpus will return a logical value - TRUE if corpus has been loaded successfully, FALSE if not.

Author

Andreas Blaette, Bernard Desgraupes, Sylvain Loiseau

Examples

cqp_is_initialized() # check initialization status
#> [1] TRUE
if (!cqp_is_initialized()) cqp_initialize()
cqp_is_initialized() # check initialization status (TRUE now?)
#> [1] TRUE
cqp_get_registry() # get registry dir used by CQP
#> /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/Rtmpk6lOF7/registry_tmp
cqp_list_corpora() # get list of corpora
#> [1] "UNGA"    "REUTERS"