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