kwic: KWIC output / concordances

Description Usage Arguments See Also Examples

Description

Prepare and show concordances / keyword-in-context (kwic). The same result can be achieved by applying the kwich method on either a partition or a context object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
kwic(.Object, ...)

## S4 method for signature 'context'
kwic(.Object, meta = getOption("polmineR.meta"),
  cpos = TRUE, neighbor = NULL, verbose = FALSE)

## S4 method for signature 'partition'
kwic(.Object, query, cqp = is.cqp,
  left = getOption("polmineR.left"), right = getOption("polmineR.right"),
  meta = getOption("polmineR.meta"), pAttribute = "word",
  sAttribute = NULL, cpos = TRUE, neighbor = NULL, verbose = TRUE)

## S4 method for signature 'character'
kwic(.Object, query, cqp = is.cqp,
  left = getOption("polmineR.left"), right = getOption("polmineR.right"),
  meta = getOption("polmineR.meta"), pAttribute = "word",
  sAttribute = NULL, cpos = TRUE, neighbor = NULL, verbose = TRUE)

Arguments

.Object

a partition or context object

...

further parameters to be passed

meta

metainformation to display

cpos

logical, if TRUE, the corpus positions ("cpos") if the hits will be handed over to the kwic-object that is returned

neighbor

only show kwic if a certain word is present

verbose

logical, whether to be talkative

query

a query, CQP-syntax can be used

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.query auxiliary function)

left

to the left

right

to the right

pAttribute

p-attribute, defaults to 'word'

sAttribute

if provided, the s-attribute will be used to check the boundaries of the text

See Also

To read the whole text, see the read-method.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
if (require(polmineR.sampleCorpus) && require(rcqp)){
  use("polmineR.sampleCorpus")
  bt <- partition("PLPRBTTXT", def=list(text_date=".*"), regex=TRUE)
  kwic(bt, "Integration")
  kwic(
    bt, "Integration",
    left=20, right=20,
    meta=c("text_date", "text_name", "text_party")
  )
  kwic(
    bt, '"Integration" [] "(Menschen|Migrant.*|Personen)"',
    left=20, right=20,
    meta=c("text_date", "text_name", "text_party")
  ) 
}

## End(Not run)

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