Learn R Programming

polmineR (version 0.7.5)

RegistryFile-class: Read, parse and modify registry file.

Description

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.

Arguments

corpus

name of the CWB corpus

new

a new value to set

filename

a filename

package

name of a package

registry

directory of the registry (defaults to CORPUS_Registry environment variable)

Fields

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

Methods

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.

Details

An appendix to the 'Corpus Encoding Tutorial' (http://cwb.sourceforge.net/files/CWB_Encoding_Tutorial.pdf) includes an explanation of the registry file format.