Learn R Programming

rcqp (version 0.5)

cqi_struc2cpos: Convert structural indices

Description

Get the corpus positions or the string associated to a structural position.

Usage

cqi_struc2cpos(attribute, struc)
	cqi_struc2str(attribute, ids)

Arguments

attribute

(string) the qualified name of an attribute.

struc

(integer)

ids

(integer vector)

Value

The cqi_struc2cpos function returns a pair of corpus positions: the corpus positions of the first token (immediately following the start tag) and of the last token (immediately preceding the end tag) of the token region.

The cqi_struc2str function returns a string.

Details

The structural attributes correspond to XML pairs of tags in the corpus. Matching pairs of XML start and end tags are encoded as token regions. The struc parameter is the index of a particular pair of tags. The cqi_struc2cpos function associates the corpus positions of the specified pair.

References

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

See Also

cqi_alg2cpos, cqi_cpos2alg, cqi_cpos2id, cqi_cpos2lbound, cqi_cpos2rbound, cqi_cpos2str, cqi_cpos2struc, cqi_id2cpos, cqi_id2freq, cqi_id2str, cqi_regex2id, cqi_str2id.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
for (i in 0:10) {
	print(cqi_struc2cpos("DICKENS.novel", i))
}

cqi_struc2str("DICKENS.novel_title", 1:10)
cqi_struc2str("DICKENS.chapter_title", 1:10)
# }

Run the code above in your browser using DataLab