blob: 1cff680ceca469afbcb633fa09bda49a1390e72a [file] [log] [blame]
Marc Kupietz5a336b62021-11-27 17:51:35 +01001library(RKorAPClient)
2library(tidyverse)
3library(knitr)
Marc Kupietz1644e602021-12-19 16:27:40 +01004
5nodeWordform <- 'aufmerksam'
6mdFile <- tempfile(nodeWordform, fileext = ".md")
7
Marc Kupietz5a336b62021-11-27 17:51:35 +01008new("KorAPConnection", verbose = TRUE) %>%
9 collocationAnalysis(
Marc Kupietz1644e602021-12-19 16:27:40 +010010 nodeWordform,
Marc Kupietz5a336b62021-11-27 17:51:35 +010011 leftContextSize = 2,
12 rightContextSize = 2,
13 exactFrequencies = TRUE,
14 searchHitsSampleLimit = 1000,
15 topCollocatesLimit = 10,
Marc Kupietz5a336b62021-11-27 17:51:35 +010016 maxRecurse = 1,
Marc Kupietz1644e602021-12-19 16:27:40 +010017 addExamples = TRUE
Marc Kupietz5a336b62021-11-27 17:51:35 +010018 ) %>%
Marc Kupietz5a336b62021-11-27 17:51:35 +010019 mutate(LVC = sprintf("[%s](%s)", example, webUIRequestUrl)) %>%
20 { . ->> ca } %>%
21 select(LVC, logDice, pmi, ll) %>%
22 head(50) %>%
Marc Kupietz1644e602021-12-19 16:27:40 +010023 kable(format = "pipe", digits = 2) %>%
24 cat(file = mdFile, sep = "\n")
Marc Kupietz5a336b62021-11-27 17:51:35 +010025
Marc Kupietz1644e602021-12-19 16:27:40 +010026rmarkdown::render(mdFile)
27browseURL(gsub("\\.md", ".html", mdFile))