blob: 51d73c1feb0ecf43b14ffcc1be7cc4a667d4575d [file] [log] [blame]
library(RKorAPClient)
library(tidyverse)
library(knitr)
library(rmarkdown)
lvLemma <- "nehmen"
mdFile <- tempfile(lvLemma, fileext = ".md")
cat(file=mdFile, sprintf("---\ntitle: LVC analysis of %s\n---\n\n", lvLemma))
new("KorAPConnection", verbose = TRUE) %>%
collocationAnalysis(
sprintf("focus(in [tt/p=NN] {[tt/l=%s]})", lvLemma),
leftContextSize = 1,
rightContextSize = 0,
exactFrequencies = FALSE,
searchHitsSampleLimit = 1000,
topCollocatesLimit = 20
) %>%
mutate(LVC = sprintf("[in %s %s](%s)", collocate, lvLemma, webUIRequestUrl)) %>%
select(LVC, logDice, pmi, ll) %>%
head(10) %>%
kable(format = "pipe", digits = 2) %>%
cat(file = mdFile, sep = "\n", append = TRUE)
rmarkdown::render(mdFile)
browseURL(str_replace(mdFile, "\\.md$", ".html"))