head(kwic(data_char_inaugural, "secure*", window = 3, valuetype = "glob"))
head(kwic(data_char_inaugural, "secur", window = 3, valuetype = "regex"))
head(kwic(data_char_inaugural, "security", window = 3, valuetype = "fixed"))
kwic(data_corpus_inaugural, "war against")
kwic(data_corpus_inaugural, "war against", valuetype = "regex")
mykwic <- kwic(data_corpus_inaugural, "provident*")
is.kwic(mykwic)
is.kwic("Not a kwic")
# as.kwic examples
txt <- c("This is a test",
"This is it.",
"What is in a train?",
"Is it a question?",
"Sometimes you don't know if this is it.",
"Is it a bird or a plane or is it a train?")
toks <- tokens(txt)
(kwOld <- kwic(toks, "is it", new = FALSE))
(kwNew <- kwic(toks, "is it", new = TRUE))
## Not run:
# # this breaks - need to harmonize print methods
# as.kwic(kwNew)
# ## End(Not run)
Run the code above in your browser using DataLab