This micropackage converts WorldBet ASCII characters for English sounds into UTF-8 character and HTML entities.
RStudio has rich support for UTF-8 symbols. Here is how some WorldBet-to-IPA conversions look in RStudio.
library("worldbet")
# that
convert_bet_to_ipa("D@t")
#> [1] "ðæt"
# uh-oh
convert_bet_to_ipa("^?o")
#> [1] "ʌʔo"
# water, weather (vector input)
convert_bet_to_ipa(c("wA)&_r", "wED&_r"))
#> [1] "wɑɾɚ" "wɛðɚ"
From the command prompt on Windows, R falls back to escape sequences during the conversions.
# that
convert_bet_to_ipa("D@t")
#> [1] "ðæt"
# uh-oh
convert_bet_to_ipa("^?o")
#> [1] "<U+028C><U+0294>o"
# water, weather (vector input)
convert_bet_to_ipa(c("wA)&_r", "wED&_r"))
#> [1] "w<U+0251><U+027E><U+025A>" "w<U+025B>ð<U+025A>"
For RMarkdown documents, we can use HTML entities for in-text use of IPA. For example, we could write the following RMarkdown in our prose:
The word was /`r convert_bet_to_entity('SIp')`/ ("ship").
RMarkdown-to-markdown conversion then yields the following text with HTML entities instead of WorldBet symbols:
The word was /ʃɪp/ ("ship").
Finally, markdown-to-HTML conversion yields the following human-readable form of the symbols.
The word was /ʃɪp/ ("ship").
The table below shows the implementation of the WorldBet used in the package.
| WorldBet | IPA | HTML Entity |
|:---------|:----|:------------|
| p | p | p |
| b | b | b |
| m | m | m |
| t | t | t |
| d | d | d |
| n | n | n |
| k | k | k |
| g | ɡ | ɡ |
| N | ŋ | ŋ |
| ? | ʔ | ʔ |
| f | f | f |
| v | v | v |
| T | θ | θ |
| D | ð | ð |
| s | s | s |
| z | z | z |
| S | ʃ | ʃ |
| Z | ʒ | ʒ |
| h | h | h |
| h_v | ɦ | ɦ |
| ) | ɾ | ɾ |
| l | l | l |
| 9 | ɹ | ɹ |
| j | j | j |
| w | w | w |
| W | ʍ | ʍ |
| i | i | i |
| I | ɪ | ɪ |
| e | e | e |
| E | ɛ | ɛ |
| @ | æ | æ |
| a | a | a |
| & | ə | ə |
| 3 | ɜ | ɜ |
| u | u | u |
| U | ʊ | ʊ |
| o | o | o |
| ^ | ʌ | ʌ |
| > | ɔ | ɔ |
| A | ɑ | ɑ |
| _r | ˞ | ˞ |
| &_r | ɚ | ɚ |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.