Learn R Programming

polmineR (version 0.7.9)

cqp: Tools for CQP queries.

Description

Test whether a character string is a CQP query, or turn a character vector into CQP queries.

Usage

is.cqp(query)

as.cqp(query, normalise.case = FALSE, collapse = FALSE)

Arguments

query

character vector with at least one query

normalise.case

logical

collapse

logical, whether to collapse the queries into one

Value

is.cqp returns a logical value, as.cqp a character vector

Details

The is.cqp function guesses whether query is a CQP query and returns the respective logical value (TRUE/FALSE).

The as.cqp function takes a character vector as input and converts it to a CQP query by putting the individual strings in quotation marks.

References

CQP Query Language Tutorial (http://cwb.sourceforge.net/files/CQP_Tutorial.pdf)

Examples

Run this code
# NOT RUN {
is.cqp("migration") # will return FALSE
is.cqp('"migration"') # will return TRUE
is.cqp('[pos = "ADJA"] "migration"') # will return TRUE

as.cqp("migration")
as.cqp(c("migration", "diversity"))
as.cqp(c("migration", "diversity"), collapse = TRUE)
as.cqp("migration", normalise.case = TRUE)
# }

Run the code above in your browser using DataLab