blob: 6320eda47dbb4345439b39b8e2e5fc376867d488 [file] [log] [blame]
Marc Kupietz6e21b102023-06-02 18:04:04 +02001---
2title: "ICC Written Launch"
3output:
4 html_document:
5 css: style.css
6 self_contained: yes
7date: "`r Sys.Date()`"
8---
9
10```{r setup, include=FALSE, echo=FALSE, warning=FALSE}
11knitr::opts_chunk$set(echo = FALSE, warnings = FALSE)
12source("common.R")
13```
14
15# Actual composition of ICC parts
16
17## Composition by ICC genre
18
19```{r composition_by_genre, message = FALSE}
20icc_genre <- icc %>%
21 expand_grid(genre) %>%
22 mutate(vc = paste0("iccGenre=", genre)) %>%
23 rowwise() %>%
24 mutate(tokens= corpusStats(icc_con(lang, token), vc = vc)@tokens)
25
26icc_genre %>% ggplot(aes(x=lang, fill=genre, y=tokens)) +
27 geom_col() + scale_y_continuous(labels = label_number(scale_cut = cut_short_scale())) +
28 theme_ids() +
Marc Kupietz07645fb2023-06-07 11:31:07 +020029 scale_fill_ids() +
30 geom_text(aes(label=if_else(tokens > 0, as.character(tokens), ""), y=tokens), position= position_stack(reverse = F, vjust = 0.5), color="black", size=3.2, family="Fira Sans Condensed")
Marc Kupietz6e21b102023-06-02 18:04:04 +020031
32```
33
34## Composition by date of publication
35
36
Marc Kupietz985e8932023-06-07 17:48:59 +020037```{r composition_by_pubdate, message=F, warning=F}
38year <- c(1986:2023)
Marc Kupietz6e21b102023-06-02 18:04:04 +020039
40icc_year <- icc %>%
41 expand_grid(year) %>%
42 mutate(vc = paste0("pubDate in ", year)) %>%
43 rowwise() %>%
44 mutate(tokens= corpusStats(icc_con(lang, token), vc = vc)@tokens)
45
46icc_year %>% ggplot(aes(x=year, fill=lang, color=lang, y=tokens)) +
Marc Kupietz985e8932023-06-07 17:48:59 +020047 # geom_smooth(se=F, span=0.25) +
48 xlim(1990, 2023) +
49 ylim(0, NA) +
50 stat_smooth(
51 geom = 'area', method = 'loess', span = 1/4,
52 alpha = 0.1) +
53 # geom_area(alpha=0.1, position = "identity") +
54 scale_fill_ids() + scale_colour_ids() +
Marc Kupietz6e21b102023-06-02 18:04:04 +020055 scale_y_continuous(labels = label_number(scale_cut = cut_short_scale())) +
56 theme_ids()
57```
58
59## Part-of-Speech proportions
60
61```{r pos_proportions}
62POS_tag <- c(
63 "ADJ", "ADP",# "PUNCT",
64 "ADV", "AUX", # "SYM",
Marc Kupietzddda0282023-06-07 17:48:37 +020065 # "INTJ",
66 "CCONJ", # "X",
Marc Kupietz6e21b102023-06-02 18:04:04 +020067 "NOUN", "DET",
68 "PROPN", #"NUM",
69 "VERB", #"PART",
70 "PRON",
71 "SCONJ"
72 )
73
74icc_by_pos_tag <- icc %>% expand_grid(POS = POS_tag) %>%
75 rowwise() %>%
76 mutate(f = frequencyQuery(icc_con(lang), sprintf("[ud/p=%s]", POS))$f)
77
78icc_by_pos_tag %>% ggplot(aes(x=lang, fill = POS, y=f)) +
79 geom_col() + scale_y_continuous(labels = label_number(scale_cut = cut_short_scale())) +
Marc Kupietzd5540e92023-06-07 17:48:01 +020080 scale_fill_ids() + scale_color_ids() +
Marc Kupietz6e21b102023-06-02 18:04:04 +020081 theme_ids(base_size = 12) +
Marc Kupietzd5540e92023-06-07 17:48:01 +020082 geom_text(aes(label=sprintf("%.2f%%", 100*f), y=f), position= position_stack(reverse = F, vjust = 0.5), color="black", size=3.2, family="Fira Sans Condensed")
Marc Kupietz6e21b102023-06-02 18:04:04 +020083```
84
85# Pilot study: Identification of Light Verb Constructions with *take*
86
87```{r prepare_ca, output=FALSE, message=FALSE}
88
89
90
91
92```
93
94## English: *take*
95
96```{r take_icc, echo=TRUE, message=FALSE}
97take_ca_icc <-
98 collocationAnalysis(
99 icc_con("eng"),
100 "focus({[ud/l=take]} [ud/p=NOUN])",
101 leftContextSize = 0,
102 rightContextSize = 1,
103 minOccur = 2,
104 addExamples = T
105 )
106
107take_ca_icc %>% show_table()
108```
109
110## German: *nehmen*
111
112```{r nehmen_icc, echo=TRUE}
113nehmen_ca_icc <-
114 collocationAnalysis(
115 icc_con("ger"),
116 "focus([tt/p=NN] {[tt/l=nehmen]})",
117 leftContextSize = 1,
118 rightContextSize = 0,
119 minOccur = 2,
120 addExamples = T
121 )
122nehmen_ca_icc %>% show_table()
123```
124
125### For comparison based on the whole DeReKo
126
127```{r nehmen_dereko}
128nehmen_ca_dereko <- readRDS("../data/ca_nehmen_dereko_examples")
129nehmen_ca_dereko %>% show_table()
130```
131
132## Norwegian: *ta*
133
Marc Kupietzd75a1792023-06-07 17:47:23 +0200134```{r ta_icc, echo=T, message=FALSE}
Marc Kupietz6e21b102023-06-02 18:04:04 +0200135ta_ca_icc <-
136 collocationAnalysis(
137 icc_con("nor"),
138 "focus({[ud/l=ta]} [ud/p=NOUN])",
139 leftContextSize = 0,
140 rightContextSize = 1,
141 minOccur = 2,
142 addExamples = T
143 )
144ta_ca_icc %>% show_table()
145```
146