kwic(x, keywords, window = 5, valuetype = c("glob", "regex", "fixed"), case_insensitive = TRUE, ...)
"kwic"(x, keywords, window = 5, valuetype = c("glob", "regex", "fixed"), case_insensitive = TRUE, ...)
"kwic"(x, keywords, window = 5, valuetype = c("glob", "regex", "fixed"), case_insensitive = TRUE, ...)
"kwic"(x, keywords, window = 5, valuetype = c("glob", "regex", "fixed"), case_insensitive = TRUE, ...)
"print"(x, ...)
keywords
will be tokenized using the ...
options."glob"
for
"glob"-style wildcard expressions; "regex"
for regular expressions;
or "fixed"
for exact matching (entire words, for instance). If
"fixed"
is used with case_insensitive = TRUE
, the text will
be lowercased prior to matching.TRUE
docname
), the token index position (position
), the context
before (contextPre
), the keyword in its original format
(keyword
, preserving case and attached punctuation), and the context
after (contextPost
).
head(kwic(inaugTexts, "secure*", window = 3, valuetype = "glob"))
head(kwic(inaugTexts, "secur", window = 3, valuetype = "regex"))
head(kwic(inaugTexts, "security", window = 3, valuetype = "fixed"))
kwic(inaugCorpus, "war against")
kwic(inaugCorpus, "war against", valuetype = "regex")
Run the code above in your browser using DataLab