# NOT RUN {
use("polmineR")
# basic usage
K <- kwic("GERMAPARLMINI", "Integration")
if (interactive()) show(K)
oil <- corpus("REUTERS") %>% kwic(query = "oil")
if (interactive()) show(oil)
oil <- corpus("REUTERS") %>%
kwic(query = "oil") %>%
highlight(yellow = "crude")
if (interactive()) show(oil)
# increase left and right context and display metadata
K <- kwic(
"GERMAPARLMINI",
"Integration", left = 20, right = 20,
s_attributes = c("date", "speaker", "party")
)
if (interactive()) show(K)
# use CQP syntax for matching
K <- kwic(
"GERMAPARLMINI",
'"Integration" [] "(Menschen|Migrant.*|Personen)"', cqp = TRUE,
left = 20, right = 20,
s_attributes = c("date", "speaker", "party")
)
if (interactive()) show(K)
# check that boundary of region is not transgressed
K <- kwic(
"GERMAPARLMINI",
'"Sehr" "geehrte"', cqp = TRUE,
left = 100, right = 100,
boundary = "date"
)
if (interactive()) show(K)
# use positivelist and highlight matches in context
K <- kwic("GERMAPARLMINI", query = "Integration", positivelist = "[Ee]urop.*", regex = TRUE)
K <- highlight(K, yellow = "[Ee]urop.*", regex = TRUE)
# }
Run the code above in your browser using DataLab