term_context | R Documentation |
Shamelessly borrowing the quanteda::kwic()
function (https://quanteda.io/index.html) for keyword search
term_context(
data,
pattern,
window = 5,
valuetype = c("glob", "regex", "fixed")
)
data |
Data frame created by |
pattern |
Keyword or phrase to search for (See examples) |
window |
Number of words to display on either side of the keyword match |
valuetype |
Type of pattern match. "glob" for glob-style wildcards, "regex" for regular expressions, "fixed" for exact matching |
quanteda object with 7 variables (docname or index, from, to, pre, keyword, post, pattern
)
## Not run:
# single token
term_context(data, pattern = "quality", window = 4, valuetype = "glob")
term_context(data, pattern = "qual", valuetype = "regex", window = 4)
# phrase matching
term_context(data, pattern = "cheap quality", window = 4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.