-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrajeg_denistia_2023_bank-data-verba-BI.qmd
312 lines (294 loc) · 13.2 KB
/
rajeg_denistia_2023_bank-data-verba-BI.qmd
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
---
title: "VerbInd: Pangkalan data verba bahasa Indonesia berbasis korpus"
author:
- name:
given: Gede Primahadi Wijaya
family: Rajeg
url: https://www.ling-phil.ox.ac.uk/people/gede-rajeg
orcid: 0000-0002-2047-8621
attributes:
- corresponding: true
affiliations:
- University of Oxford
- Universitas Udayana
- name:
given: Karlina
family: Denistia
url: https://www.researchgate.net/profile/Karlina-Denistia
orcid: 0000-0002-1060-3548
attributes:
- corresponding: false
affiliations:
- Universitas Sebelas Maret
format:
html:
page-layout: full
google-scholar: true
appendix-cite-as: display
date: 2023-05-18
date-modified: now
doi: 10.5281/zenodo.7947605
citation:
type: dataset
publisher: Zenodo
doi: 10.5281/zenodo.7947605
version: 0.0.1
editor: visual
csl: "unified-style-sheet-for-linguistics.csl"
bibliography: references.bib
---
# Pengantar
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" alt="Creative Commons License" style="border-width:0"/></a> [![](https://img.shields.io/badge/doi-10.5281/zenodo.7947605-blue.svg)](https://doi.org/10.5281/zenodo.7947605) [![](https://img.shields.io/badge/doi-10.17605/OSF.IO/VQGKX-blue.svg)](https://doi.org/10.17605/OSF.IO/VQGKX) <br />*VerbInd* berlisensi <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
------------------------------------------------------------------------
Berikut adalah cara mengutip *VerbInd* ketika dirujuk dalam penelitian dan/atau pengajaran bahasa Indonesia:
> Rajeg, G. P. W., & Denistia, K. (2023). *VerbInd*: Pangkalan data verba bahasa Indonesia berbasis korpus (Version 0.0.1) \[Dataset\]. https://gederajeg.github.io/database-verba-bahasa-indonesia/
*VerbInd* dibangun dari pangkalan data leksikal verba bahasa Indonesia berbasis korpus [@rajeg2023]. Pangkalan data tersebut melandasi bab buku berjudul [*Afiksasi Verba dalam Bahasa Indonesia*](https://doi.org/10.6084/m9.figshare.22336729) [@rajeg2023a], yang akan terbit dalam bunga rampai sebagai bagian dari proyek penulisan buku Tatabahasa Bahasa Indonesia Kontemporer (TBIK) berbasis korpus ([flyer seminar hasil](https://www.facebook.com/photo?fbid=581508360693816&set=a.227078366136819) dan [rekaman seminar hasil](https://www.youtube.com/live/fD70Nhs6vug?feature=share)).
# Tabel data
```{r setup, message = FALSE, echo = FALSE}
library(tidyverse)
library(reactable)
library(htmltools)
verba <- read_tsv("https://raw.githubusercontent.com/gederajeg/afiksasi-verba-bahasa-indonesia/main/verbs_main.txt") %>%
select(year,
form = word_form,
freq = n,
genres,
morph = morphind,
pref = pref_morphind,
root = root_morphind,
root_POS = root_pos_morphind,
suff = suff_morphind #,
# affix = affix_morphind,
# affix_wclass = affix_morphind_wclass
) %>%
mutate(across(c(pref, root_POS, suff, genres), as.factor))
# Select input filter with an "All" default option
selectFilter <- function(tableId, style = "width: 100%; height: 100%;") {
function(values, name) {
tags$select(
# Set to undefined to clear the filter
onchange = sprintf("
const value = event.target.value
Reactable.setFilter('%s', '%s', value === '__ALL__' ? undefined : value)
", tableId, name),
# "All" has a special value to clear the filter, and is the default option
tags$option(value = "__ALL__", "All"),
lapply(unique(values), tags$option),
"aria-label" = sprintf("Filter %s", name),
style = style
)
}
}
# Creates a data list column filter for a table with the given ID
dataListFilter <- function(tableId, style = "width: 100%; height: 28px;") {
function(values, name) {
dataListId <- sprintf("%s-%s-list", tableId, name)
tagList(
tags$input(
type = "text",
list = dataListId,
oninput = sprintf("Reactable.setFilter('%s', '%s', event.target.value || undefined)", tableId, name),
"aria-label" = sprintf("Filter %s", name),
style = style
),
tags$datalist(
id = dataListId,
lapply(unique(values), function(value) tags$option(value = value))
)
)
}
}
```
```{css my-css, echo = FALSE}
.my-row:hover {
background-color: #f5f8ff;
}
```
*VerbInd* dihasilkan dari Korpus Bahasa Indonesia Kontemporer yang dikumpulkan oleh Pusat Pengembangan dan Pelindungan Bahasa dan Sastra, Badan Pengembangan dan Pembinaan Bahasa, Kementerian Pendidikan, Kebudayaan, Riset, dan Teknologi. *VerbInd* terdiri atas `r ncol(verba)` kolom. Kolom `year` menunjukkan informasi tahun sumber teks korpusnya, sedangkan `genres` merupakan jenis ragam teks di dalam korpus. Kolom `freq` menunjukkan berapa kali verba dalam kolom `form` muncul di suatu ragam teks pada tahun tertentu. Kolom `morph` adalah luaran analisis pemilahan struktur morfologis kata menggunakan *MorphInd* [@larasati2011], yang juga dipadukan dengan *MALINDO Morph* [@nomoto2018]. Analisis morfologis tersebut telah dan terus akan diperbaiki secara manual jika terdapat kekeliruan. Kolom `pref` (prefiks/awalan), `root` (akar kata), `root_POS` (kelas kata akar kata), dan `suff` (sufiks/akhiran) diekstraksi dari komponen luaran *MorphInd*.
```{r print-table, echo = FALSE}
reactable(verba,
defaultPageSize = 20,
showPageInfo = TRUE,
defaultSorted = list(year = "asc",
genres = "asc",
freq = "desc"),
style = list(fontFamily = "Work Sans, sans-serif",
fontSize = "0.85rem"),
elementId = "tbl-input",
compact = TRUE,
resizable = FALSE,
rowClass = "my-row",
wrap = FALSE,
columns = list(
year = colDef(
filterable = TRUE,
filterInput = selectFilter("tbl-input")
),
form = colDef(
filterable = TRUE,
sticky = "left",
# Filter by case-insensitive text match
filterMethod = JS("function(rows, columnId, filterValue) {
const pattern = new RegExp(filterValue, 'i')
return rows.filter(function(row) {
return pattern.test(row.values[columnId])
})
}")
),
genres = colDef(
filterable = TRUE,
filterInput = selectFilter("tbl-input")),
root = colDef(
filterable = TRUE,
align = "center",
# Filter by case-insensitive text match
filterMethod = JS("function(rows, columnId, filterValue) {
const pattern = new RegExp(filterValue, 'i')
return rows.filter(function(row) {
return pattern.test(row.values[columnId])
})
}")
),
morph = colDef(
filterable = TRUE,
filterInput = dataListFilter("tbl-input"),
# Exact match filter method
filterMethod = JS("(rows, columnId, filterValue) => {
return rows.filter(row => row.values[columnId] === filterValue)
}")
# Filter by case-insensitive text match
#filterMethod = JS("function(rows, columnId, filterValue) {
#const pattern = new RegExp(filterValue, 'i')
#return rows.filter(function(row) {
#return pattern.test(row.values[columnId])
#})
#}")
),
pref = colDef(
filterable = TRUE,
align = "center",
filterInput = dataListFilter("tbl-input"),
# Exact match filter method
filterMethod = JS("(rows, columnId, filterValue) => {
return rows.filter(row => row.values[columnId] === filterValue)
}")
# filterInput = selectFilter("tbl-input")
),
suff = colDef(
filterable = TRUE,
sticky = "left",
align = "center",
filterInput = dataListFilter("tbl-input"),
# Exact match filter method
filterMethod = JS("(rows, columnId, filterValue) => {
return rows.filter(row => row.values[columnId] === filterValue)
}")
# filterInput = selectFilter("tbl-input")
),
root_POS = colDef(
filterable = TRUE,
align = "center",
filterInput = dataListFilter("tbl-input"),
# Exact match filter method
filterMethod = JS("(rows, columnId, filterValue) => {
return rows.filter(row => row.values[columnId] === filterValue)
}")
# filterInput = selectFilter("tbl-input")
)
# affix = colDef(
# filterable = TRUE,
# # Filter by case-insensitive text match
# filterMethod = JS("function(rows, columnId, filterValue) {
# const pattern = new RegExp(filterValue, 'i')
# return rows.filter(function(row) {
# return pattern.test(row.values[columnId])
# })
# }")
# ),
# affix_wclass = colDef(
# filterable = TRUE,
# # Filter by case-insensitive text match
# filterMethod = JS("function(rows, columnId, filterValue) {
# const pattern = new RegExp(filterValue, 'i')
# return rows.filter(function(row) {
# return pattern.test(row.values[columnId])
# })
# }")
# )
)
) %>%
reactablefmtr::add_title("Frekuensi verba bahasa Indonesia menurut ragam teks dan tahun", align = "left", font_color = "royalblue1", font_size = 20, margin = c(5,5,10,5))
```
Tabel berikut menampilkan gabungan frekuensi tiap-tiap bentuk kata (`form`) dari keseluruhan ragam teks dan tahun.
```{r unique-data-preparation, echo = FALSE, message = FALSE, warning = FALSE}
# create a summarised data without year and genres
# and remove the form with final hypen (asuming it is part of reduplication)
verba_unique_form <- verba %>%
select(-year, -genres) %>%
filter(str_detect(form, "\\-$", negate = TRUE)) %>%
distinct() %>%
group_by(form, morph, pref, root, root_POS, suff) %>%
summarise(freq = sum(freq)) %>%
arrange(pref, root, desc(freq))
verba_unique_form1 <- verba_unique_form %>%
group_by(morph, pref, root, root_POS, suff) %>%
mutate(n_form = n_distinct(form),
form2 = paste(paste(form, " (", freq, ")", sep = ""), collapse = "; ")) %>%
arrange(desc(form2))
verba_unique_form2 <- verba_unique_form1 %>%
group_by(morph, pref, root, root_POS, suff, form2, n_form) %>%
summarise(freq = sum(freq)) %>%
mutate(form = str_extract(form2,
"^[^ ]+(?=\\s)"),
form = if_else(n_form > 1,
str_extract(form2,
"((?<=\\s)|(?<=^))[a-z]+(?=\\s)"
),
form),
form2 = if_else(n_form == 1, "", form2))
```
```{r unique-data-print, echo = FALSE, message = FALSE, warning = FALSE}
nested_info_id <- which(verba_unique_form2$n_form > 1)
tb <- select(verba_unique_form2,
form,
orth_var = form2,
morph, pref, root, root_POS, suff, freq)
tb_main <- select(ungroup(tb), form, root, freq)
reactable(tb_main,
columns = list(
form = colDef(filterable = TRUE,
sticky = "left",
# Filter by case-insensitive text match
filterMethod = JS("function(rows, columnId, filterValue) {
const pattern = new RegExp(filterValue, 'i')
return rows.filter(function(row) {
return pattern.test(row.values[columnId])
})
}")
),
root = colDef(
filterable = TRUE,
align = "center",
# Filter by case-insensitive text match
filterMethod = JS("function(rows, columnId, filterValue) {
const pattern = new RegExp(filterValue, 'i')
return rows.filter(function(row) {
return pattern.test(row.values[columnId])
})
}")
)
),
style = list(fontFamily = "Work Sans, sans-serif",
fontSize = "0.85rem"),
details = function(index) {
if (index %in% nested_info_id) {
orth_var_data <- tb[index, ] %>%
ungroup() %>%
select(-form, -freq, -root)
htmltools::div(style = "padding: 1rem", reactable(orth_var_data, outlined = TRUE, resizable = TRUE, fullWidth = TRUE))
# htmltools::tags$button(type = "button", reactable(orth_var_data, outlined = TRUE, resizable = TRUE, fullWidth = TRUE))
}
}) %>%
reactablefmtr::add_title("Frekuensi verba bahasa Indonesia keseluruhan", align = "left", font_color = "royalblue1", font_size = 20, margin = c(5,5,10,5))
```
# Daftar pustaka