cqi_cpos2id: Convert a corpus position

Description Usage Arguments Details Value Author(s) Source References See Also Examples

View source: R/main.R

Description

Associate a corpus position to other parameters.

Usage

1
2
3
4
5
6
7
	cqi_cpos2id(attribute, cpos)
	cqi_cpos2lbound(attribute, cpos)
	cqi_cpos2rbound(attribute, cpos)
	cqi_cpos2str(attribute, cpos)
	cqi_cpos2alg(attribute, cpos)
	cqi_cpos2struc(attribute, cpos)
	cqi_alg2cpos(attribute, alg)

Arguments

attribute

(string) the qualified name of an attribute.

cpos

(integer vector) a list of corpus positions

alg

(integer) an alignment ID

Details

The cqi_cpos2id and cqi_cpos2str functions apply to positional attributes.

The cqi_cpos2lbound, cqi_cpos2rbound and cqi_cpos2struc functions apply to structural attributes.

The cqi_alg2cpos function applies to alignment attributes (in the case of aligned corpora).

Value

cqi_cpos2str returns a vector of strings.

The cqi_alg2cpos function returns a 4-elements vector representing the start and end positions of an alignment in the source corpus and the start and end positions in the target corpus.

The other functions return a vector of integers representing corpus positions.

Author(s)

Bernard Desgraupes - [email protected] - University Paris-10.
Sylvain Loiseau - [email protected] - University Paris-13.

Source

The IMS Open Corpus Workbench (CWB) at http://cwb.sourceforge.net/

References

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

See Also

cqi_id2cpos, cqi_id2freq, cqi_id2str, cqi_regex2id, cqi_str2id, cqi_struc2cpos, cqi_struc2str.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
cqi_query("DICKENS","Foo","\"eas(y|ier|iest)\";")
cpos <- cqi_dump_subcorpus("DICKENS:Foo")[1:20,1]

cqi_cpos2id("DICKENS.pos", cpos)
cqi_cpos2str("DICKENS.pos", cpos)
cqi_cpos2id("DICKENS.word", cpos)
cqi_cpos2str("DICKENS.word", cpos)
cqi_cpos2id("DICKENS.lemma", cpos)
cqi_cpos2str("DICKENS.lemma", cpos)

cqi_query("DICKENS","Foo","\"interesting\";")
cpos <- cqi_dump_subcorpus("DICKENS:Foo",1,10)[,1]

# Expects structural attributes
cqi_cpos2lbound("DICKENS.chapter", cpos)
cqi_cpos2rbound("DICKENS.chapter", cpos)

cqi_cpos2struc("DICKENS.chapter", cpos)

## End(Not run)

PolMine/rcqp.mac documentation built on Dec. 19, 2017, 3:12 a.m.