Skip to content

Instantly share code, notes, and snippets.

@SwadicalRag
Created November 6, 2018 06:56
Show Gist options
  • Save SwadicalRag/b0fb17ef2c592390dc5047ba6434985f to your computer and use it in GitHub Desktop.
Save SwadicalRag/b0fb17ef2c592390dc5047ba6434985f to your computer and use it in GitHub Desktop.
local phonemes = {
["AA"] = "ɑ",
["AE"] = "æ",
["AH"] = "ʌ",
["AO"] = "ɔ",
["AW"] = "ɑʊ",
["AY"] = "ɑɪ",
["B"] = "b",
["CH"] = "ʧ",
["D"] = "d",
["DH"] = "ð",
["EH"] = "ɛ",
["ER"] = "ɜɹ",
["EY"] = "eɪ",
["F"] = "f",
["G"] = "ɡ",
["HH"] = "h",
["IH"] = "i",
["IY"] = "ɪː",
["JH"] = "ʤ",
["K"] = "k",
["L"] = "l",
["M"] = "m",
["N"] = "n",
["NG"] = "ŋ",
["OW"] = "oʊ",
["OY"] = "ɔɪ",
["P"] = "p",
["R"] = "ɹ",
["S"] = "s",
["SH"] = "ʃ",
["SIL"] = ".",
["T"] = "t",
["TH"] = "θ",
["UH"] = "ʊ",
["UW"] = "u",
["V"] = "v",
["W"] = "w",
["Y"] = "j",
["Z"] = "z",
["ZH"] = "ʒ",
}
function decodePhone(str)
str = str:gsub("[A-Za-z]+",function(phon)
return phonemes[phon]
end)
return str
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment