Learn R Programming

phonTools (version 0.2-2.2)

xsampatoIPA: Convert X-Sampa to IPA

Description

Convert a vector of x-sampa vowel descriptions to values that can be used to plot IPA.

Usage

xsampatoIPA (vowels, chart = FALSE, verify = FALSE)

Value

A vector of the same length as 'vowels', with the values required to plot the desired vowels.

Arguments

vowels

A vector representing vowel labels in x-sampa to be converted to values that can be used to plot the corresponding IPA symbols. If this is not provided a plot comparing IPA to x-sampa representations is displayed.

chart

If TRUE, a plot comparing IPA to x-sampa representations is displayed.

verify

If TRUE, the selected symbols are plotted to allow for verification.

Author

Santiago Barreda <sbarreda@ucdavis.edu>

Details

This function converts x-sampa to values that can be used to plot IPA symbols by passing them to the 'pch' parameter within plotting functions. At the moment it has only been implemented for vowel sounds. The function also generate a figure comparing IPA to x-sampa vowel representations that may be useful to some users.

**There may be issues when exporting figures to PDF using IPA font. Exporting plots directly as images works 'out of the box'**

References

http://en.wikipedia.org/wiki/X-SAMPA

Examples

Run this code

## compare x-sampa and IPA vpwel charts
#xsampatoIPA ()
## some examples
#IPA = xsampatoIPA (c('I','3','e','Q'))
#plot (1:5, pch = IPA, cex = 2)

Run the code above in your browser using DataLab