Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 1 | library(RKorAPClient) |
| 2 | library(tidyverse) |
| 3 | library(knitr) |
Marc Kupietz | 1644e60 | 2021-12-19 16:27:40 +0100 | [diff] [blame] | 4 | |
| 5 | nodeWordform <- 'aufmerksam' |
| 6 | mdFile <- tempfile(nodeWordform, fileext = ".md") |
| 7 | |
Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 8 | new("KorAPConnection", verbose = TRUE) %>% |
| 9 | collocationAnalysis( |
Marc Kupietz | 1644e60 | 2021-12-19 16:27:40 +0100 | [diff] [blame] | 10 | nodeWordform, |
Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 11 | leftContextSize = 2, |
| 12 | rightContextSize = 2, |
| 13 | exactFrequencies = TRUE, |
| 14 | searchHitsSampleLimit = 1000, |
| 15 | topCollocatesLimit = 10, |
Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 16 | maxRecurse = 1, |
Marc Kupietz | 1644e60 | 2021-12-19 16:27:40 +0100 | [diff] [blame] | 17 | addExamples = TRUE |
Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 18 | ) %>% |
Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 19 | mutate(LVC = sprintf("[%s](%s)", example, webUIRequestUrl)) %>% |
| 20 | { . ->> ca } %>% |
| 21 | select(LVC, logDice, pmi, ll) %>% |
| 22 | head(50) %>% |
Marc Kupietz | 1644e60 | 2021-12-19 16:27:40 +0100 | [diff] [blame] | 23 | kable(format = "pipe", digits = 2) %>% |
| 24 | cat(file = mdFile, sep = "\n") |
Marc Kupietz | 5a336b6 | 2021-11-27 17:51:35 +0100 | [diff] [blame] | 25 | |
Marc Kupietz | 1644e60 | 2021-12-19 16:27:40 +0100 | [diff] [blame] | 26 | rmarkdown::render(mdFile) |
| 27 | browseURL(gsub("\\.md", ".html", mdFile)) |