cqi_regex2id: Find IDs by regular expression

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

View source: R/main.R

Description

Build a list of IDs of positional attributes whose names match a regular expression.

Usage

1
	cqi_regex2id(attribute, regex)

Arguments

attribute

(string) the name of a positional attribute.

regex

(string) a regular expression.

Details

This function looks in the index files corresponding to the specified positional attribute, finds the strings described by the regular expression and returns the associated indices.

Value

cqi_regex2id returns a list of integers.

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_str2id, cqi_struc2cpos, cqi_struc2str.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
rgx <- "eas(y|ier|iest)"
wids <- cqi_regex2id("DICKENS.word", rgx)
cqi_id2str("DICKENS.word", wids)

rgx <- "V.*"
pids <- cqi_regex2id("DICKENS.pos", rgx)
cqi_id2str("DICKENS.pos", pids)

rgx <- "V[aeiou].+e"
lids <- cqi_regex2id("DICKENS.lemma", rgx)
cqi_id2str("DICKENS.lemma", lids)

## End(Not run)

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