ipa: Convert phonetic representation from IPA

Description Usage Arguments Value See Also Examples

View source: R/ipa.R

Description

Converts to X-SAMPA or ARPABET (used by the CMU Pronouncing Dictionary)

Usage

1
ipa(x, to = c("xsampa", "arpabet"))

Arguments

x

A phonetic character vector in IPA

to

The phonetic alphabet to convert to. Defaults to "xsampa". "sampa" is an accepted alias for "xsampa". "arpa" and "cmu" are accepted aliases for "arpabet".

Value

A character vector the same length as x

See Also

convert_phonetics() to convert between any phonetic representations

sampa() and xsampa() to convert from X-SAMPA

arpa(), arpabet() and cmu() to convert from ARPABET (CMU)

Examples

1
2
3
4
5
6
7
8
# `ipa()` supports raw Unicode input or escaped Unicode sequences (\uxxxx),
# but raw Unicode is not supported in R package documentation,
# hence the ugly examples
ipa("\\u02cch\\u025b\\'lo\\u028a")
ipa(c("\\u02cch\\u025b\\'lo\\u028a", "w\\u025dld"))

ipa("\\u02cch\\u025b\\'lo\\u028a", to = "arpabet")
ipa(c("\\u02cch\\u025b\\'lo\\u028a", "w\\u025dld"), to = "arpabet")

Example output

[1] "\\u02cch\\u025b\\'lo\\u028a"
[1] "\\u02cch\\u025b\\'lo\\u028a" "w\\u025dld"                 
[1] "\\UW 02ccHH \\UW 025B \\'L o\\UW 028a"
[1] "\\UW 02ccHH \\UW 025B \\'L o\\UW 028a"
[2] "W \\UW 025D L D"                      

ipa documentation built on July 2, 2020, 4:14 a.m.

Related to ipa in ipa...