Module:av-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 15: Line 15:
--"c" & "g" before "i" and "e" and all that stuff
--"c" & "g" before "i" and "e" and all that stuff
word = mw.ustring.gsub(word, "c([ie])" .. "%1")
word = mw.ustring.gsub(word, "c([ie])" .. "t͡ʃ%1")
word = mw.ustring.gsub(word, "g([ie])", "x%1")
word = mw.ustring.gsub(word, "g([ie])", "d͡ʒ%1")
word = mw.ustring.gsub(word, "t([i])" .. "t͡s%1")
word = mw.ustring.gsub(word, "sc([ie])" .. "ʃ%1")


table.insert(debug, word)
table.insert(debug, word)
--alphabet-to-phoneme
--alphabet-to-phoneme
word = mw.ustring.gsub(word, "qu", "c")
word = mw.ustring.gsub(word, "ch", "k")  
word = mw.ustring.gsub(word, "ch", "ʃ") --not the real sound
word = mw.ustring.gsub(word, "sc","ʃ")
word = mw.ustring.gsub(word, '[cgjñrvy]',
word = mw.ustring.gsub(word, '[cg]',
--['g']='ɡ':  U+0067 LATIN SMALL LETTER G → U+0261 LATIN SMALL LETTER SCRIPT G
--['g']='ɡ':  U+0067 LATIN SMALL LETTER G → U+0261 LATIN SMALL LETTER SCRIPT G
{['c']='k', ['g']='ɡ', ['gn']='ɲ', })
{['c']='k', ['g']='ɡ'})
-- trill in #r, lr, nr, rr
local match_count = 0
word = mw.ustring.gsub(
word,
'(.?)ɾ(.?)',
function (before, after)
match_count = match_count + 1
-- mw.log(word, before, after)
if match_count == 1 and before == '' or before == 'l' or before == 'n'
or after ~= '' and ('bdfɡklʎmnɲpstxzʃɟ'):match(after) then
return before .. 'r' .. after
elseif before == 'ɾ' then
return 'r' .. after
elseif after == 'ɾ' then
return before .. 'r'
end
end)
word = mw.ustring.gsub(word, 'n([bm])', 'm%1')
word = mw.ustring.gsub(word, 'n([bm])', 'm%1')