knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(jtracer)
jtrace_install()

We can create new languages by creating a set of phonemes and scoring them across the seven feature dimensions the TRACE model considers. The jtrace_create_language takes care of generating a file jTRACE can read and run simulations with.

The jtrace_create_language takes, at least, a character value indicating the name you want to give your new language, a vector or phonemes (in jTRACE notation) of length M, and a M x 7 matrix or data frame with the scores (0-9) of each phoneme (rows) in each of the feature dimensions (columns). If the feature data frame includes row names with valid phoneme symbols, you can omit the phonemes argument. Optionally, you can also provide duration values (0-1) for each phoneme in each feature as a M x 7 matrix with same dimensions as the one provided in the features argument, and/or a M x M matrix stating allophonic relations between phonemes (with logical values, TRUE/FALSE). See the documentation for more details (?jtrace_create_language).

Generate a phoneme inventory

First, we create a character vector with the phoneme symbols:

p <- c("-", "a", "s", "d", "f", "g", "c") 

Then, we create a the features matrix (please note that scores are assigned randomly, and this example is not supposed to reflect a real-life case):

f <- data.frame(
  bur = c(9, 6, 4, 3, 1, 1, 2),
  voi = c(7, 4, 3, 3, 3, 3, 4),
  con = c(8, 2, 4, 2, 5, 5, 6),
  grd = c(4, 6, 1, 4, 6, 8, 6),
  dif = c(6, 3, 2, 6, 6, 6, 7),
  voc = c(3, 8, 1, 6, 6, 7, 4),
  pow = c(6, 4, 1, 6, 1, 1, 5)
)

Of course, it can be cumbersome to create a data frame like this. An alternative would be to create a table in an Excel spreadsheet and importing it to your R session or copy-pasting it into your console using the "Paste as tribble" adding from the datapasta R package.

We are all set up now!

jtrace_create_language(
  language_name = "my_language",
  phonemes = p,
  features = f
)


bilingual-project/jtracer documentation built on Dec. 19, 2021, 9:42 a.m.