knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(jtracer) jtrace_install()
At the lowest level of the TRACE model's architecture lie the acoustic features associated with the phonemes that compose words in the lexicon. jTRACE considers seven feature dimensions (see ?phonemes
): power (pow
), vocalic (vow
), diffusiveness (dif
), acuteness (acu
), consonantal (con
), voicing (voi
), and burst (bur
). These are the original dimensions used by McClelland and Elman (1986) in their original implementation of TRACE. Prior to the simulation, the model is introduced to a set of familiar phonemes, mimicking its familiarity with a language. Each of these phonemes are coded by assigning them a 1-9 score in each of the feature dimensions. McClelland and Elman's original phoneme set was later extended by Mayor and Plunkett (2014).
library(jtracer) data("phonemes") Encoding(phonemes[["ipa"]]) <- "Latin-1" Encoding(phonemes[["trace"]]) <- "Latin-1" head(phonemes)
Both versions were explicitly designed to fit the English phonology. We have coded new phonemes, not restricted to the English phonology, in the phonemes
data frame included in this package. This way, it is possible to run simlation on a model that is familiar to phonologies different than the English one, such as Spanish and Catalan. The dataframe includes three logical variables indicating whether a given phoneme is present in English (is_english
), Spanish (is_spanish
), or Catalan (is_catalan
), respectively.
library(gt) library(dplyr) phonemes %>% filter(is_english) %>% select(-starts_with("is_")) %>% rename_at(vars(pow:bur), toupper) %>% gt(rowname_col = "id", groupname_col = "type") %>% tab_spanner(md("**Acoustic features**"), columns = 6:12) %>% cols_label( ipa = md("**IPA symbol**"), trace = md("**jTRACE symbol**"), description = "" ) %>% data_color( columns = 6:12, colors = scales::col_numeric( palette = c( "white", "orange"), domain = c(0, 9) ) )
phonemes %>% filter(is_spanish) %>% select(-starts_with("is_")) %>% rename_at(vars(pow:bur), toupper) %>% gt(rowname_col = "id", groupname_col = "type") %>% tab_spanner(md("**Acoustic features**"), columns = 6:12) %>% cols_label( ipa = md("**IPA symbol**"), trace = md("**jTRACE symbol**"), description = "" ) %>% data_color( columns = 6:12, colors = scales::col_numeric( palette = c( "white", "orange"), domain = c(0, 9) ) )
phonemes %>% filter(is_catalan) %>% select(-starts_with("is_")) %>% rename_at(vars(pow:bur), toupper) %>% gt(rowname_col = "id", groupname_col = "type") %>% tab_spanner(md("**Acoustic features**"), columns = 6:12) %>% cols_label( ipa = md("**IPA symbol**"), trace = md("**jTRACE symbol**"), description = "" ) %>% data_color( columns = 6:12, colors = scales::col_numeric( palette = c( "white", "orange"), domain = c(0, 9) ) )
phonemes
datasetImagine we wanted to run some simulations on a model that is familiar to the Spanish phonology. We could do so by shortlisting those phonemes present in Spanish (is_spanish
is TRUE
) and then following the steps in the Creating a language vignette. Please note that allophonic relations and duration scalars cannot be yet modified.
spanish_phonemes <- phonemes %>% filter(is_spanish) %>% select(trace, pow:bur) jtrace_create_language( language_name = "spanish", features = spanish_phonemes )
Now we are ready to launch jTRACE running jtrace_launch()
and loading the languages/spanish.xml
file in the Phonemes tab.
How are the seven feature dimensions related to each other?
library(ggplot2) library(ggcorrplot) corr <- cor_pmat(phonemes[, 9:15]) colnames(corr) <- toupper(colnames(corr)) rownames(corr) <- toupper(colnames(corr)) ggcorrplot( corr, type = "upper", hc.order = TRUE, outline.color = "grey", lab = TRUE, colors = c("#f76560", "grey90", "#60f777"), show.diag = TRUE ) + theme_minimal() + theme( legend.position = "right", axis.title = element_blank(), axis.text = element_text(colour = "black"), panel.grid = element_blank() )
This is the complete list of implemented phonemes:
phonemes %>% rename_at(vars(pow:bur), toupper) %>% rename_at(vars(starts_with("is_")), ~gsub("is_", "", .)) %>% gt(rowname_col = "id", groupname_col = "type") %>% tab_spanner(md("**Acoustic features**"), columns = 6:12) %>% cols_label( ipa = md("**IPA**"), trace = md("**jTRACE**"), description = "" ) %>% data_color( columns = 6:12, colors = scales::col_numeric( palette = c( "white", "orange"), domain = c(0, 9) ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.