-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_1.Rmd
30 lines (25 loc) · 1.12 KB
/
app_1.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# (APPENDIX) Appendix {-}
# Definitions
<!-- TODO Add frequency, maybe annotation data? Decide on order -->
<!-- NOTE This is not properly rendered in pdf, but it is rendered -->
```{r, "basic-def-function", include = FALSE}
definitions <- readxl::read_excel(here::here("assets", "definitions.xlsx"))
show_def <- function(l) {
tb_def <- definitions %>% filter(lemma == l) %>%
rename(sense = code, Dutch = definition, English = definition_translation) %>%
flextable(col_keys = c("sense", "Dutch", "English")) %>%
flextable::compose(j = "Dutch",
value = as_paragraph(Dutch, ": ",
as_chunk(example, props = officer::fp_text(italic = TRUE)))) %>%
flextable::compose(j = "English",
value = as_paragraph(English, ": ",
as_chunk(example_translation, props = officer::fp_text(italic = TRUE)))) %>%
autofit()
cat("## ", l, "{-} \n")
cat(knitr::knit_print(tb_def))
cat(" \n")
}
```
```{r, echo = FALSE, results = 'asis'}
for(lemma in unique(definitions$lemma)) show_def(lemma)
```