The class includes methods to read, modify and write a registry file. Several operations could be accomplished with the 'cwb-regedit' tool, the functions defined here ensure that manipulating the registry is possible without a full installation of the CWB.
name of the CWB corpus
a new value to set
a filename
name of a package
directory of the registry (defaults to CORPUS_Registry environment variable)
registryDir
registry directory
encoding
corpus encoding
txt
registry as character vector
pAttributes
p-attributes
properties
corpus properties
id
corpus id
home
home directory
name
corpus name
info
path to info file
addPAttribute(pAttribute)
Add an p-attribute.
addSAttribute(sAttribute)
Add an s-attribute.
adjustHome()
Reset the home directory. This will usually be necessary after installing a data package.
dropSAttribute(sAttribute)
Drop a s-attribute.
getEncoding()
Get the encoding.
getHome()
Get the home directory of a corpus.
getId()
Get the id of a corpus.
getInfo()
Get path to the info file.
getName()
Get the name of a corpus.
getPAttributes()
Get the pAttributes.
getProperties()
Get corpus properties.
getSAttributes()
Get the sAttributes.
initialize(corpus = NULL, registry = Sys.getenv("CORPUS_REGISTRY"),
package = NULL, filename = NULL)
Initialize a new RegistryFile object.
parse()
Parse the registry file.
read()
Read file from disc, as character vector in field 'txt'.
setHome(new)
Set the home directory to a new location.
setId(new)
Set the id of a corpus
setProperty(property, value)
Set a corpus property.
write(filename = NULL)
Write registry file to disk.
An appendix to the 'Corpus Encoding Tutorial' (http://cwb.sourceforge.net/files/CWB_Encoding_Tutorial.pdf) includes an explanation of the registry file format.