Learn R Programming

rcqp (version 0.5)

cqi_regex2id: Find IDs by regular expression

Description

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

Usage

cqi_regex2id(attribute, regex)

Arguments

attribute

(string) the name of a positional attribute.

regex

(string) a regular expression.

Value

cqi_regex2id returns a list of integers.

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.

References

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

See Also

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

Examples

Run this code
# NOT RUN {
# }
# 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)
# }

Run the code above in your browser using DataLab