ranges: Get ranges for query.

rangesR Documentation

Get ranges for query.

Description

Get ranges (pairs of left and right corpus positions) for queries.

Usage

ranges(.Object, ...)

## S4 method for signature 'corpus'
ranges(
  .Object,
  query,
  cqp = FALSE,
  check = TRUE,
  p_attribute = "word",
  verbose = TRUE,
  mc = 1L,
  progress = FALSE
)

## S4 method for signature 'character'
ranges(
  .Object,
  query,
  cqp = FALSE,
  check = TRUE,
  p_attribute = "word",
  verbose = TRUE,
  mc = 1L,
  progress = FALSE
)

## S4 method for signature 'subcorpus'
ranges(
  .Object,
  query,
  cqp = FALSE,
  check = TRUE,
  p_attribute = "word",
  verbose = TRUE,
  mc = 1L,
  progress = FALSE
)

## S4 method for signature 'partition'
ranges(
  .Object,
  query,
  cqp = FALSE,
  check = TRUE,
  p_attribute = "word",
  verbose = TRUE,
  mc = 1L,
  progress = FALSE
)

Arguments

.Object

A length-one character vector indicating a CWB corpus, or a corpus, or partition object.

...

Used for reasons of backwards compatibility to process arguments that have been renamed (e.g. pAttribute).

query

A character vector providing one or multiple queries (token to look up, regular expression or CQP query). Token ids (i.e. integer values) are also accepted. If query is neither a regular expression nor a CQP query, a sanity check removes accidental leading/trailing whitespace, issuing a respective warning.

cqp

Either logical (TRUE if query is a CQP query), or a function to check whether query is a CQP query or not (defaults to is.cqp auxiliary function).

check

A logical value, whether to check validity of CQP query using check_cqp_query.

p_attribute

The p-attribute to search. Needs to be stated only if query is not a CQP query. Defaults to NULL.

verbose

A logical value, whether to show messages.

mc

If logical value TRUE, the value of getOption("polmineR.cores") is passed into mclapply or pblapply as the specification of the number of cores to use. It is also possible to supply an integer value with the number of cores directly. Defaults to 1 (no multicore). Relevant only if several queries are to be processed.

progress

A logical value, whether to show a progess bar when processing multiple queries.


polmineR documentation built on Nov. 2, 2023, 5:52 p.m.