View source: R/switch_transcriptions.R
switch_transcriptions | R Documentation |
A function to switch between ARPABET, Wells' Lexical Sets, the B_T set, and the IPA.
switch_transcriptions(
x,
.from,
.to,
ordered = TRUE,
as_character = FALSE,
warn = TRUE
)
arpa_to_b_t(...)
arpa_to_ipa(...)
arpa_to_wells(...)
b_t_to_arpa(...)
b_t_to_ipa(...)
b_t_to_wells(...)
ipa_to_arpa(...)
ipa_to_b_t(...)
ipa_to_wells(...)
wells_to_arpa(...)
wells_to_ipa(...)
wells_to_b_t(...)
x |
The vector containing the vowel labels you want to convert. |
.from |
an unquoted expression. By default, |
.to |
an unquoted expression. By default, |
ordered |
a logical. by default, |
as_character |
a logical. |
warn |
a logical, |
Linguists use different ways to code English vowels in a computer-friendly way. FAVE-Align and MFA use ARPABET, which assigns a two-letter code to each vowel phoneme (IY, IH, EY, EH, etc.). An alternative approach is to use a keyword denoting a lexical set, whether it be the original Wells keywords or an alternative using the "B_T" frame. See this blog post for more background.
The ARPABET symbols in this function are IY, IH, EY, EH, AE, AA, AO, AH, OW, UH, UW, AY, AW, OY, ER.
The original Wells' lexical keywords in this function are FLEECE, KIT, FACE, DRESS, TRAP, LOT, THOUGHT, STRUT, GOAT, FOOT, GOOSE, PRICE, MOUTH, CHOICE, and NURSE.
The lexical set using the B_T frame include BEET, BIT, BAIT, BET, BAT, BOT, BOUGHT, BUT, BOAT, BOOK, BOOT, BITE, BOUT, BOY, and BIRD.
The IPA symbols include i, ɪ, e, ɛ, æ, ɑ, ɔ, ʌ, o, ʊ, u, ɑɪ, ɑʊ, ɔɪ, and ɚ.
Note that arpa_to_wells
is shorthand for switch_transcriptions(..., .from=arpa, .to=wells)
,
and only exports to the Wells lexical sets. All other pairs of transcription systems have
their own shortcut function as well (i.e. wells_to_b_t
, b_t_to_ipa
, ipa_to_wells
, etc.).
A vector with the factors recoded. Any string that is not in one of the preset lists of symbols will remain unchanged.
suppressPackageStartupMessages(library(tidyverse))
darla <- joeysvowels::darla
darla %>%
mutate(vowel = switch_transcriptions(vowel, .from = arpa, .to = wells)) %>%
count(vowel)
darla %>%
mutate(vowel = switch_transcriptions(vowel, .from = arpa, .to = wells, ordered = FALSE)) %>%
count(vowel)
darla %>%
mutate(vowel = switch_transcriptions(vowel, .from = arpa, .to = b_t, as_character = TRUE)) %>%
count(vowel)
# Works even if not all vowel levels are present
darla %>%
filter(vowel %in% c("IY", "AE", "AY", "UW")) %>%
mutate(vowel = switch_transcriptions(vowel, .from = arpa, .to = b_t)) %>%
count(vowel)
# Here's a non-tidyverse version (though tidyverse is still used under the hood)
darla$vowel <- switch_transcriptions(darla$vowel, .from = arpa, .to = b_t)
# Note that shortcut functions also exist:
darla %>%
mutate(vowel = arpa_to_wells(vowel)) %>%
count(vowel)
darla %>%
mutate(vowel = arpa_to_b_t(vowel)) %>%
count(vowel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.