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