--[=[
local initials = {
= 'k', = 'kʰ', = 'g', = 'ng',
= 'ts', = 'z', = 'ny',
= 't', = 'th', = 'd', = 'n',
= 'p', = 'ph', = 'f', = 'b', = 'm',
= 'y', = 'r', = 'l', = 'w',
= 'x', = 'sh', = 'h', = '',
}
local medials = {
= '', = 'y', = 'r', = 'w',
}
local vowels = {
= 'a', = 'aa', = 'aa', = 'i', = 'ii', = 'u', = 'uu', = 'o',
= 'e', = 'e', = 'ae', = 'ae', = 'o',
= 'au', = 'aau', = 'iu', = 'eo', = 'aeo',
= 'eu', = 'eu', = 'oe', = 'oe', = 'o', = 'o', = 'aɨ',
}
local finals = {
= '', = 'k', = 'ng', = 't', = 'n',
= 'p', = 'm', = 'i',
}
local tones = {
= 'A', = 'B', = 'C', = 'D', = 'E', = 'F',
}
]=]
local export = {}
local initials = {
= 'k', = 'kʰ', = 'ɡ', = 'ŋ',
= 't͡s', = 'z', = 'ɲ',
= 't', = 'tʰ', = 'd', = 'n',
= 'p', = 'pʰ', = 'f', = 'b', = 'm',
= 'j', = 'r', = 'l', = 'w',
= 'θ', = 'sʰ', = 'h', = 'ʔ',
= 'ʃ',
}
local medials = {
= '', = 'j', = 'r', = 'w',
}
local vowels = {
= 'a', = 'aː', = 'aː', = 'i', = 'iː', = 'u', = 'uː', = 'o',
= 'eː', = 'e', = 'ɛː', = 'ɛ', = 'ɔ',
= 'aw', = 'aːw', = 'iw', = 'ew', = 'ɛw',
= 'ɯ', = 'ɯː', = 'ɤ', = 'ɤː', = 'oː', = 'ɔː', = 'aɰ',
}
local finals = {
= '', = 'k̚', = 'ŋ', = 't̚', = 'n',
= 'p̚', = 'm', = 'j',
}
local tones = {
= '˨˦', = '˩', = '˧˧˨', = '˥', = '˦˨ʔ͉', = '˧˦˧',
}
function export.tr(text, lang, sc, debug_mode)
local args = frame:getParent().args
local text = args or PAGENAME -- supports only one pronunciation
local debug = args or nil
local qualifier = args or nil
local ipa = {}
for syl in mw.text.gsplit(text, '') do
syl = mw.ustring.gsub(syl, 'ႆ', 'ၺ်')
local i, m, v, f, t = mw.ustring.match(syl,
'^()(?)(*)(*)(?)$')
if i == 'သ' and m == 'ျ' then
i = 'သျ'
m = ''
end
if m == 'ႂ' and v == '်' then
m = ''
v = 'ႂ်'
end
if v == 'ူ' and f ~= '' then
v = 'ူ*'
end
if debug then
table.insert(ipa, '')
else
table.insert(ipa, initials .. medials .. vowels .. finals .. tones)
end
end
return '* ' .. (qualifier and frame:expandTemplate{title = 'qualifier', args = {qualifier}} .. ' ' or '') .. ']<sup>(])</sup>: <span class="IPA">/' .. table.concat(ipa, '.') .. '/</span>]'
end
return export