context-method: Analyze context of a node word

Description Usage Arguments Value Author(s) Examples

Description

Retrieve the word context of a token, checking for the boundaries of a XML region. For formulating the query, CPQ syntax may be used (see examples). Statistical tests available are log-likelihood, t-test, pmi.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## S4 method for signature 'partition'
context(.Object, query, cqp = is.cqp,
  pAttribute = getOption("polmineR.pAttribute"), sAttribute = NULL,
  left = getOption("polmineR.left"), right = getOption("polmineR.right"),
  stoplist = NULL, positivelist = NULL, count = TRUE, method = "ll",
  mc = getOption("polmineR.mc"), verbose = TRUE, progress = FALSE)

## S4 method for signature 'character'
context(.Object, ...)

## S4 method for signature 'Corpus'
context(.Object,
  pAttribute = getOption("polmineR.pAttribute"), ...)

## S4 method for signature 'partitionBundle'
context(.Object, query, verbose = TRUE, ...)

## S4 method for signature 'cooccurrences'
context(.Object, query, complete = FALSE)

Arguments

.Object

a partition or a partitionBundle object

query

query, which may by a character vector or a cqpQuery object

cqp

defaults to is.cqp-function, or provide TRUE/FALSE

pAttribute

p-attribute of the query

sAttribute

if provided, it will be checked that cpos do not extend beyond the region defined by the s-attribute

left

no of tokens and to the left of the node word

right

no of tokens to the right of the node word

stoplist

exclude a query hit from analysis if stopword(s) is/are in context

positivelist

character vector or numeric vector: include a query hit only if token in positivelist is present. If positivelist is a character vector, it is assumed to provide regex expressions (incredibly long if the list is long)

count

logical

method

either "LL" (default) or "pmi", if NULL, calculating the statistics will be skipped

mc

whether to use multicore; if NULL (default), the function will get the value from the options

verbose

report progress, defaults to TRUE

progress

logical, whether to show progress bar

...

further parameters

complete

enhance completely

Value

depending on whether a partition or a partitionBundle serves as input, the return will be a context object, or a contextBundle object

Author(s)

Andreas Blaette

Examples

1
2
3
4
5
6
## Not run: 
  use("polmineR.sampleCorpus")
  p <- partition("PLPRBTTXT", list(text_type="speech"))
  a <- context(p, query="Integration", pAttribute="word")

## End(Not run)

nrauscher/corpus documentation built on May 23, 2019, 9:34 p.m.