blob: ce2be8b727392f23509db77b93882e218f14110f [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) %>%
Marc Kupietza8f90402023-04-16 14:23:05 +020023 slice_head(n = 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)
Marc Kupietzef747772022-09-06 10:59:16 +020028browseURL(str_replace(mdFile, "\\.md$", ".html"))