Burmese pronunciation and romanisation module. See {{my-IPA}}
.
See Module:User:Verdy p/my-pron.
local export = {}
local gsub = mw.ustring.gsub
local sub = mw.ustring.sub
local match = mw.ustring.match
local system_list = {
{ --] name = 'IPA', type = 'phonetic', },
{ --] name = 'MLCTS', type = 'orthographic', },
{ --] name = 'ALA-LC', type = 'orthographic', },
{ --] name = 'BGN/PCGN', type = 'phonetic', },
{ --] name = 'Okell', type = 'phonetic', },
}
-- This sort order is assumed in both export.generate_tests and export.make functions, so do it only once
-- but actually the table is already sorted by its first element which is also its index position,
-- so this is not even needed (and storing the system_index in table is not even needed, so it was commented out):
--table.sort(system_list, function(a, b) return a < b end)
--[[
Helper tables for phonetic transcriptions or orthographic romanisations:
- initial_voicing: from Myanmar initial consonnants to de/voiced Myanmar consonnants
- initial_table: from Myanmar consonnants to phonetic/orthographic initial clusters
- nucleus_table: from Myanmar central vowels to phonetic/orthographic central vowels
- final_table: from Myanmar vowel+trailers to phonetic/orthographic final clusters
- indep_letter_table: from Myanmar independant vowel to phonetic/orthographic vowels with diacritics or syllables
- tone_table: from Myanmar preposed tone diacritics to phonetic/orthographic diacritics or modifiers
- ambig_intersyl: pairs of letters that must be hyphen-separated in orthographic romanizations to preserve Myanmar syllables
]]
local initial_voicing = {
= 'ဂ', = 'ဂ',
= 'ဇ', = 'ဇ',
= 'ဍ', = 'ဍ',
= 'ဒ', = 'ဒ',
= 'ဗ', = 'ဗ',
= 'ဖ',
}
local initial_table = {
--]
= { 'k', 'k', 'k', 'k', 'k' },
= { 't͡ɕ', 'ky', 'ky', 'ky', 'c' },
= { 't͡ɕ', 'kr', 'kr', 'ky', 'c' },
= { 't͡ɕw', 'kyw', 'kyv', 'kyw', 'cw' },
= { 't͡ɕw', 'krw', 'krv', 'kyw', 'cw' },
= { 'kw', 'kw', 'kv', 'kw', 'kw' },
= { 'kʰ', 'hk', 'kh', 'hk', 'hk' },
= { 't͡ɕʰ', 'hky', 'khy', 'ch', 'hc' },
= { 't͡ɕʰ', 'hkr', 'khr', 'ch', 'hc' },
= { 't͡ɕʰw', 'hkyw', 'khyv', 'chw', 'hcw' },
= { 't͡ɕʰw', 'hkrw', 'khrv', 'chw', 'hcw' },
= { 'kʰw', 'hkw', 'khv', 'hkw', 'hkw' },
= { 'ɡ', 'g', 'g', 'g', 'g' },
= { 'd͡ʑ', 'gy', 'gy', 'gy', 'j' },
= { 'd͡ʑ', 'gr', 'gr', 'gy', 'j' },
= { 'd͡ʑw', 'gyw', 'gyv', 'gyw', 'jw' },
= { 'ɡw', 'gw', 'gv', 'gw', 'gw' },
= { 'ɡ', 'gh', 'gh', 'g', 'g' },
= { 'ŋ', 'ng', 'ṅ', 'ng', 'ng' },
= { 'ŋ̊', 'hng', 'ṅh', 'hng', 'hng' },
= { 'ɲ', 'ngr', 'ṅr', 'ny', 'ny' },
= { 'ɲ̊', 'hngr', 'ṅrh', 'hny', 'hny' },
= { 'ŋw', 'ngw', 'ṅv', 'ngw', 'ngw' },
= { 'ŋ̊w', 'hngw', 'ṅvh', 'hngw', 'hngw' },
= { 's', 'c', 'c', 's', 's' },
= { 'sw', 'cw', 'cv', 'sw', 'sw' },
= { 'sʰ', 'hc', 'ch', 'hs', 'hs' },
= { 'sʰw', 'hcw', 'chv', 'hsw', 'hsw' },
= { 'z', 'j', 'j', 'z', 'z' },
= { 'zw', 'jw', 'jv', 'zw', 'zw' },
= { 'z', 'jh', 'jh', 'z', 'z' },
= { 'ɲ', 'ny', 'ñ', 'ny', 'ny' },
= { 'ɲ', 'ny', 'ññ', 'ny', 'ny' },
= { 'ɲ̊', 'hny', 'ñh', 'hny', 'hny' },
= { 'ɲ̊', 'hny', 'ññh', 'hny', 'hny' },
= { 'ɲw', 'nyw', 'ñv', 'nyw', 'nyw' },
= { 'ɲ̊w', 'hnyw', 'ñvh', 'hnyw', 'hnyw' },
= { 't', 't', 'ṭ', 't', 't' },
= { 'tʰ', 'ht', 'ṭh', 'ht', 'ht' },
= { 'd', 'd', 'ḍ', 'd', 'd' },
= { 'd', 'dh', 'ḍh', 'd', 'd' },
= { 'n', 'n', 'ṇ', 'n', 'n' },
= { 'n̥', 'hn', 'ṇh', 'hn', 'hn' },
= { 't', 't', 't', 't', 't' },
= { 'tj', 'ty', 'ty', 'ty', 'ty' },
= { 'tɹ', 'tr', 'tr', 'tr', 'tr' },
= { 'tw', 'tw', 'tv', 'tw', 'tw' },
= { 'tʰ', 'ht', 'th', 'ht', 'ht' },
= { 'tʰw', 'htw', 'thv', 'htw', 'htw' },
= { 'd', 'd', 'd', 'd', 'd' },
= { 'dj', 'dy', 'dy', 'dy', 'dy' },
= { 'dɹ', 'dr', 'dr', 'dr', 'dr' },
= { 'dw', 'dw', 'dv', 'dw', 'dw' },
= { 'd', 'dh', 'dh', 'd', 'd' },
= { 'n', 'n', 'n', 'n', 'n' },
= { 'n̥', 'hn', 'nh', 'hn', 'hn' },
= { 'nw', 'nw', 'nv', 'nw', 'nw' },
= { 'n̥w', 'hnw', 'nvh', 'hnw', 'hnw' },
= { 'p', 'p', 'p', 'p', 'p' },
= { 'pj', 'py', 'py', 'py', 'py' },
= { 'pj', 'pr', 'pr', 'py', 'py' },
= { 'pw', 'prw', 'prv', 'pw', 'pw' },
= { 'pw', 'pw', 'pv', 'pw', 'pw' },
= { 'pʰ', 'hp', 'ph', 'hp', 'hp' },
= { 'pʰj', 'hpy', 'phy', 'hpy', 'hpy' },
= { 'pʰj', 'hpr', 'phr', 'hpy', 'hpy' },
= { 'pʰw', 'hpw', 'phv', 'hpw', 'hpw' },
= { 'b', 'b', 'b', 'b', 'b' },
= { 'bj', 'by', 'by', 'by', 'by' },
= { 'bj', 'br', 'br', 'by', 'by' },
= { 'bw', 'bw', 'bv', 'bw', 'bw' },
= { 'b', 'bh', 'bh', 'b', 'b' },
= { 'pʰ', 'bh', 'bh', 'hp', 'hp' },
= { 'bw', 'bhw', 'bhv', 'bw', 'bw' },
= { 'pʰw', 'bhw', 'bhw', 'hpw', 'hpw' },
= { 'm', 'm', 'm', 'm', 'm' },
= { 'm̥', 'hm', 'mh', 'hm', 'hm' },
= { 'mj', 'my', 'my', 'my', 'my' },
= { 'm̥j', 'hmy', 'myh', 'hmy', 'hmy' },
= { 'mj', 'mr', 'mr', 'my', 'my' },
= { 'm̥j', 'hmr', 'mrh', 'hmy', 'hmy' },
= { 'mjw', 'mrw', 'mrv', 'myw', 'myw' },
= { 'm̥w', 'hmrw', 'mrvh', 'hmw', 'hmw' },
= { 'mw', 'mw', 'mv', 'mw', 'mw' },
= { 'm̥w', 'hmw', 'mvh', 'hmw', 'hmw' },
= { 'j', 'y', 'y', 'y', 'y' },
= { 'ʃ', 'hy', 'yh', 'sh', 'hy' },
= { 'ʃ', 'hsy', 'syh', 'sh', 'hy' },
= { 'jw', 'yw', 'yv', 'yw', 'yw' },
= { 'j', 'r', 'r', 'y', 'y' },
= { 'ɹ', 'r', 'r', 'r', 'r' },
= { 'ʃ', 'hr', 'rh', 'sh', 'hy' },
= { 'jw', 'rw', 'rv', 'yw', 'yw' },
= { 'ʃw', 'hrw', 'rvh', 'shw', 'hyw' },
= { 'l', 'l', 'l', 'l', 'l' },
= { 'l̥', 'hl', 'lh', 'hl', 'hl' },
= { 'j', 'ly', 'ly', 'y', 'y' },
= { 'j', 'hsy', 'syh', 'y', 'y' },
= { 'lj', 'ly', 'ly', 'ly', 'ly' },
= { 'ʃ', 'hly', 'lyh', 'sh', 'hy' },
= { 'l̥j', 'hly', 'lyh', 'hly', 'hly' },
= { 'lw', 'lw', 'lv', 'lw', 'lw' },
= { 'l̥w', 'hlw', 'lvh', 'hlw', 'hlw' },
= { 'w', 'w', 'v', 'w', 'w' },
= { 'ʍ', 'hw', 'vh', 'hw', 'hw' },
= { 'θ', 's', 's', 'th', 'th' },
= { 'ð', 's', 's', 'dh', 'th' },
= { 'θw', 'sw', 'sv', 'thw', 'thw' },
= { 'ðw', 'sw', 'sw', 'dhw', 'thw' },
= { 'h', 'h', 'h', 'h', 'h' },
= { 'hw', 'hw', 'hv', 'hw', 'hw' },
= { 'l', 'l', 'ḷ', 'l', 'l' },
= { 'ʔ', '', '’', '', '' },
= { nil, 'ss', 'ss', nil, nil },
= { 'ʔ', '', '', '', '' },
= { '', '', '', '', '' },
= { nil, 'y', 'y', nil, nil },
= { nil, 'r', 'r', nil, nil },
= { nil, 'w', 'w', nil, nil },
}
local final_table = {
--]
= { 'a̰', 'a.', 'a', 'a.', 'á' },
= { 'ɛʔ', 'ak', 'ak‘', 'et', 'eʔ' },
= { 'ɪ̀ɴ', 'ang', 'aṅ‘', 'in', 'iñ' },
= { 'ɪʔ', 'ac', 'ac‘', 'it', 'iʔ' },
= { 'ì', 'any', 'aññ‘', 'i', 'i' },
= { 'è', 'any', 'aññ‘', 'e', 'ei' },
= { 'ɛ̀', 'any', 'aññ‘', 'è', 'e' },
= { 'ɪ̀ɴ', 'any', 'añ‘', 'in', 'iñ' },
= { 'aʔ', 'at', 'at‘', 'at', 'aʔ' },
= { 'àɴ', 'an', 'an‘', 'an', 'añ' },
= { 'aʔ', 'ap', 'ap‘', 'at', 'aʔ' },
= { 'àɴ', 'am', 'am‘', 'an', 'añ' },
= { 'ɛ̀', 'ai', 'ay‘', 'è', 'e' },
= { 'àɴ', 'am', 'aṃ', 'an', 'añ' },
= { 'à', 'a', 'ā', 'a', 'a' },
= { 'à', 'a', 'ā', 'a', 'a' },
= { 'ḭ', 'i.', 'i', 'i.', 'í' },
= { 'eɪʔ', 'it', 'it‘', 'eik', 'eiʔ' },
= { 'èɪɴ', 'in', 'in‘', 'ein', 'eiñ' },
= { 'eɪʔ', 'ip', 'ip‘', 'eik', 'eiʔ' },
= { 'èɪɴ', 'im', 'im‘', 'ein', 'eiñ' },
= { 'èɪɴ', 'im', 'iṃ', 'ein', 'eiñ' },
= { 'ì', 'i', 'ī', 'i', 'i' },
= { 'ṵ', 'u.', 'u', 'u.', 'ú' },
= { 'oʊʔ', 'ut', 'ut‘', 'ok', 'ouʔ' },
= { 'òʊɴ', 'un', 'un‘', 'on', 'ouñ' },
= { 'oʊʔ', 'up', 'up‘', 'ok', 'ouʔ' },
= { 'òʊɴ', 'um', 'um‘', 'on', 'ouñ' },
= { 'òʊɴ', 'um', 'uṃ', 'on', 'ouñ' },
= { 'ù', 'u', 'ū', 'u', 'u' },
= { 'è', 'e', 'e', 'e', 'ei' },
= { 'ɛ́', 'ai:', 'ai', 'è:', 'è' },
= { 'ɔ́', 'au:', 'o', 'aw:', 'ò' },
= { 'aʊʔ', 'auk', 'ok‘', 'auk', 'auʔ' },
= { 'àʊɴ', 'aung', 'oṅ‘', 'aung', 'auñ' },
= { 'ɔ̀', 'au', 'o‘', 'aw', 'o' },
= { 'ò', 'ui', 'ui', 'o', 'ou' },
= { 'aɪʔ', 'uik', 'uik‘', 'aik', 'aiʔ' },
= { 'àɪɴ', 'uing', 'uiṅ‘', 'aing', 'aiñ' },
= { 'ʊʔ', 'wat', 'vat‘', 'ut', 'uʔ' },
= { 'ʊ̀ɴ', 'wan', 'van‘', 'un', 'uñ' },
= { 'ʊʔ', 'wap', 'vap‘', 'ut', 'uʔ' },
= { 'ʊ̀ɴ', 'wam', 'vam‘', 'un', 'uñ' },
= { 'ʊ̀ɴ', 'wam', 'vaṃ', 'un', 'uñ' },
= { 'ə', 'a', 'a', 'ă', 'ă' },
= { '', '', '‘', '', '' },
}
local nucleus_table = {
--]
= { 'à', 'a', 'a', 'a', 'a' },
= { 'ì', 'i', 'i', 'i', 'i' },
= { 'ù', 'u', 'u', 'u', 'u' },
= { 'ɔ̀', 'au', 'o', 'aw', 'o' },
= { 'ɔ̀', 'au', 'o', 'aw', 'o' },
= { 'ʊ̀', 'wa', 'va', 'u', 'u' },
}
local indep_letter_table = {
--]
= { 'ḭ', 'i.', 'i', 'i.', 'í' },
= { 'ì', 'i', 'ī', 'i', 'i' },
= { 'ṵ', 'u.', 'u', 'u.', 'ú' },
= { 'ù', 'u', 'ū', 'u', 'u' },
= { 'è', 'e', 'e', 'e', 'ei' },
= { 'ɛ̰', 'e', 'e*', 'è.', 'é' },
= { 'ɔ́', 'au:', 'o', 'aw:', 'ò' },
= { 'ɔ̀', 'au', 'o‘', 'aw', 'o' },
= { 'n̥aɪʔ', 'hnai.', 'n*', 'hnaik', 'hnaiʔ' },
= { 'jwḛ', 'rwe', 'r*', 'ywe.', 'yweí' },
}
local tone_table = {
--]
= { '́', ':', '″', ':', '̀' },
= { '̰', '.', '′', '.', '́' },
}
local ambig_intersyl = {
= {}, --]
= { --]
ky = 1, kr = 1, kw = 1,
gy = 1, gr = 1, gw = 1,
ny = 1, ng = 1,
cw = 1, tw = 1, nw = 1,
py = 1, pr = 1, pw = 1,
my = 1, mr = 1, mw = 1,
},
= {}, --]
= { --]
ky = 1, kr = 1, kw = 1,
gy = 1, gr = 1, gw = 1,
ny = 1, ng = 1,
cw = 1, tw = 1, nw = 1,
tr = 1, tw = 1,
py = 1, pr = 1, pw = 1,
my = 1, mr = 1, mw = 1,
},
= { --]
ou = 1,
},
}
--[[
Helper tables for reverse transcriptions from romanisations to Myanmar script:
Used to exhibit cases where phonetic transcriptions or romanizations are not reversible.
The following is made for the BGN/PCGN romanization.
]]
local reverse_table = {
k = 'က', hk = 'ခ', g = 'ဂ',
kw = 'ကွ', hkw = 'ခွ', gw = 'ဂွ',
c = 'ကျ', hc = 'ချ', j = 'ဂျ',
cw = 'ကျွ', hcw = 'ချွ', jw = 'ဂျွ',
ng = 'င', hng = 'ငှ',
ngw = 'ငွ', hngw = 'ငွှ',
s = 'စ', hs = 'ဆ', z = 'ဇ',
sw = 'စွ', hsw = 'ဆွ', zw = 'ဇွ',
ny = 'ည', hny = 'ညှ',
nyw = 'ညွ', hnyw = 'ညွှ',
t = 'တ', ht = 'ထ', d = 'ဒ',
tw = 'တွ', htw = 'ထွ', dw = 'ဒွ',
n = 'န', hn = 'နှ',
nw = 'နွ', hnw = 'နွှ',
p = 'ပ', hp = 'ဖ', b = 'ဗ',
py = 'ပျ', hpy = 'ဖျ', by = 'ဗျ',
pw = 'ပွ', hpw = 'ဖွ', bw = 'ဗွ',
m = 'မ', hm = 'မှ',
my = 'မျ', hmy = 'မျှ',
mw = 'မွ', hmw = 'မွှ',
y = 'ယ', hy = 'ရှ',
yw = 'ယွ', hyw = 'ရွှ',
r = '*ရ',
th = 'သ', = '+သ',
thw = 'သွ',
l = 'လ', hl = 'လှ',
ly = '*လျ', hly = '*လျှ',
lw = 'လွ', hlw = 'လွှ',
w = 'ဝ', hw = 'ဝှ', --]
h = 'ဟ', hw = 'ဟွ', --]
= 'အ',
a = 'ာ', = 'ား', = '', = 'တ်',
= 'န်', = 'န်း', = 'န့်',
i = 'ီ', = 'ီး', = 'ိ', = 'စ်',
= 'င်', = 'င်း', = 'င့်',
ei = 'ေ', = 'ေး', = 'ေ့', = 'ိတ်',
= 'ိန်', = 'ိန်း', = 'ိန့်',
e = 'ယ်', = 'ဲ', = 'ယ့်', = 'က်',
= 'ိုင်', = 'ိုင်း', = 'ိုင့်', = 'ိုက်',
o = 'ော်', = 'ော', = 'ော့', = 'ောက်',
= 'ောင်', = 'ောင်း', = 'ောင့်',
ou = 'ို', = 'ိုး', = 'ို့', = 'ုပ်',
= 'ုန်', = 'ုန်း', = 'ုန့်',
u = 'ူ', = 'ူး', = 'ု', = 'ွတ်',
= 'ွန်', = 'ွန်း', = 'ွန့်',
= "'",
}
function syllabify(text)
text = text
:gsub("('?)(*)", function(a, b)
if a .. b ~= '' then return a .. ' ' .. b end
end)
:gsub('(?)(.?)(.?)', function(a, b, c)
return
c == '္' and ' ' .. a .. b .. ' ' .. c or
c == '်' and ' ' .. a .. b .. c or
' ' .. a .. ' ' .. b .. c
end) .. ' '
text = text
:gsub("(်း?'?)", '%1 ')
:gsub('()(်)', '%2%1')
local breaker = '(**)(?)'
while match(text, breaker) do
text = text:gsub(breaker, '%1 %2')
end
text = text
:gsub('္', ' , ')
:gsub(' +', ' ' )
:gsub('^ ?(.*) ?$', '%1' )
:gsub(' , ', ' ' )
:gsub(' ()', '%1' )
return text
end
function initial_by_char(initial_string, system_index, ref_table)
local initial_set = {}
for character in mw.text.gsplit(initial_string, '') do
local temp_initial = ref_table or error('Initial data not found.')
table.insert(initial_set, temp_initial or temp_initial)
end
return table.concat(initial_set)
end
function process(initial, final, tone, schwa, system, system_index)
if system.type == 'phonetic' and match(initial .. final, 'ွှ?') then
initial = gsub(initial, '', '')
final = 'ွ' .. final
else
initial = gsub(initial, '/', '')
end
local initial_new = system.type == 'phonetic' and gsub(initial, '%+.', initial_voicing) or initial
if indep_letter_table then
initial_new = match(initial_new, '') and '-' or ''
final = initial .. final
end
if initial_new == 'မြွ' then require('Module:debug').track('my-pron/mrw') end
local initial_data =
initial_table
or initial_table', '')]
or system.type == 'orthographic' and initial_by_char(initial_new, system_index, initial_table)
or error('Initial data not found.')
local initial_value =
initial_data
or initial_data
if match(initial, '^%+') and system_index == 5 then
initial_value = initial_table
initial_value = gsub(initial_value, '^(+)', '<u>%1</u>')
end
local final_value =
final_table
or system.type == 'phonetic' and
final_table
or indep_letter_table
or gsub(final, '^(*)()(်?)$', function(first, second, third)
first_data =
nucleus_table
or final_table
or indep_letter_table
or first
second_data =
initial_table
or second
first =
first_data ~= first and first_data
or first
second = second_data ~= second
and second_data .. ((system_index == 3 and third ~= '') and '‘' or '')
or second
return (gsub(first .. second, '()(.*)', '%2'))
end)
final_value = mw.ustring.toNFD(
type(final_value) == 'table' and final_value or final_value
)
if tone == '' then
tone_value = ''
else
if system_index ~= 4 then final_value = gsub(final_value, '̀', '') end
final_value = gsub(final_value, '', '')
if system.type .. schwa == "phonetic'" then
tone_value = ''
else
tone_data = tone_table or error('Tone data not found.')
tone_value = tone_data
end
end
if system_index == 1 then
final_value = gsub(final_value, '^()', '%1' .. tone_value)
elseif system_index == 5 then
final_value = gsub(final_value, '()(*)$', '%1' .. tone_value .. '%2')
else
final_value = final_value .. tone_value
end
return mw.ustring.toNFC(initial_value .. final_value)
end
function remove_wide_space(text)
return gsub(text, ' ', '')
end
function concatenate(set, system_index)
if system_index == 1 then
return remove_wide_space(table.concat(set))
else
local result = remove_wide_space(table.concat(set, ' '))
for count = 1, 3 do
result = gsub(result, '(.) (.)(?)',
function(previous, next, after_next)
if ambig_intersyl
or (system_index == 2 or system_index == 4)
and ( match(previous .. ' ' .. next, ' ')
or match(previous .. next .. after_next, '')
and not match(after_next, '')
)
then
return previous .. '-' .. next .. after_next
else
return previous .. next .. after_next
end
end)
end
return result
end
end
function export.get_romanisation(word, pronunciations, system, system_index, mode)
word = syllabify(word:gsub(' ', '|')):gsub('ါ', 'ာ')
if system.type == 'phonetic' then
word = word:gsub('ဝ()', 'ဝွ%1')
end
local sentences = {}
for phrase in mw.text.gsplit(word, '|', true) do
local temp, syllable = {}, mw.text.split(phrase, ' ', true)
for syllable_index = 1, #syllable do
syllable = gsub(syllable, '()(်)', '%2%1')
temp = gsub(
syllable,
"^(*?ွ?ှ?/?)(*)(?)('?)$",
function(initial, final, tone, schwa)
return process(initial, final, tone, schwa, system, system_index)
end)
end
table.insert(sentences, concatenate(temp, system_index))
end
sentences = table.concat(sentences, ' ')
if mode ~= 'translit_module' then
table.insert(pronunciations, sentences)
end
return sentences
end
function generate_respelling(text)
text = text:gsub(' ', ' '):gsub('ါ', 'ာ')
if match(text, '') then return text end
text = text
:gsub("(%+?)(*)(/?)(+)",
function(voicing_mark, latin_initial, opt_sep, latin_final)
return
voicing_mark ..
( reverse_table or
initial_by_char(latin_initial, nil, reverse_table)
) ..
opt_sep ..
reverse_table
end)
return text
end
function export.generate_tests(word, respelling)
word = word:generate_respelling()
local p = {
orthographic = word,
phonetic = respelling:generate_respelling() or word
}
local result = {}
for system_index, system in ipairs(system_list) do
local pronunciations = export.get_romanisation(p, pronunciations, system, system_index)
table.insert(result, table.concat(pronunciations))
end
return table.concat(result, ' | '):gsub('<u>', '('):gsub('</u>', ')')
end
function respelling_format(phonetic, page_title)
local page_title_set = mw.text.split(syllabify(page_title), ' ')
local new_respellings = {}
for _, respelling in ipairs(phonetic) do
local respelling_set = mw.text.split(syllabify(respelling), ' ')
if table.concat(respelling_set):gsub("", '') == table.concat(page_title_set):gsub('ါ', 'ာ') then
for index, element in ipairs(respelling_set) do
if element ~= page_title_set then
respelling_set = tostring(mw.html.create('b'):attr('style', 'font-size:110%;color:#A32214'):wikitext(element))
end
end
end
table.insert(new_respellings, table.concat(respelling_set))
end
return table.concat(new_respellings, ', ')
:remove_wide_space()
:gsub('.', initial_voicing)
:gsub('(ေ?)ာ', '%1ါ')
end
function export.make(frame)
local args = frame:getParent().args
local page_title = mw.title.getCurrentTitle().text
local title = generate_respelling(args.word or page_title)
if not args then args = { title } end
local p = {
phonetic = {},
orthographic = {},
}
for index, item in ipairs(args) do
if item ~= '' then
table.insert(p.phonetic, generate_respelling(item))
end
end
local pronunciations = {}
for system_index, system in ipairs(system_list) do
for _, word in ipairs(p) do
pronunciations = export.get_romanisation(word, pronunciations, system, system_index)
end
end
local result = {
-- orthographic = { title },
-- phonetic = {}
}
if title ~= table.concat(args) then
table.insert(result,
'* Phonetic respelling' .. (#p.phonetic > 1 and 's' or '') ..
': ' ..
tostring(mw.html.create('span')
:attr('lang', 'my')
:attr('class', 'Mymr')
:wikitext(
respelling_format(p.phonetic, page_title)
)) .. '\n'
)
end
table.insert(result,
'* ]' ..
tostring(mw.html.create('sup'):wikitext(
'(])'
))
.. ': ' ..
tostring(mw.html.create('span')
:attr('class', 'IPA')
:wikitext(
'/' ..
gsub(table.concat(pronunciations, '/, /'), 'ʔʔ', 'ʔ.ʔ') ..
'/'
)) ..
'\n* ] '
)
for system_index = 2, 5 do
table.insert(result,
'<em>' .. system_list.name .. ':</em> ' ..
table.concat(pronunciations, '/')
)
end
return table.concat(result, ' • ')
end
return export