Remove a corpus from the list of loaded corpora of the corpus library (CL).

cl_delete_corpus(corpus, registry = Sys.getenv("CORPUS_REGISTRY"))

Arguments

corpus

name of a CWB corpus (upper case)

registry

path to the registry directory, defaults to the value of the environment variable CORPUS_REGISTRY

Value

An integer value 1 is returned invisibly if a previously loaded corpus has been deleted, or 0 if the corpus has not been loaded and has not been deleted.

Details

The corpus library (CL) internally maintains a list of corpora including information on positional and structural attributes so that the registry file needs not be parsed again and again. However, when an attribute has been added to the corpus, it will not yet be visible, because it is not part of the data that has been loaded. The cl_delete_corpus function exposes a CL function named identically, to force reloading the corpus (after it has been deleted), which will include parsing an updated registry file.

Examples

cl_attribute_size("UNGA", attribute = "word", attribute_type = "p")
#> [1] 127082
corpus_is_loaded("UNGA")
#> [1] TRUE
cl_delete_corpus("UNGA")
#> [1] TRUE
corpus_is_loaded("UNGA")
#> [1] FALSE