Module:qlu-pron: Difference between revisions

No edit summary
No edit summary
Line 18: Line 18:
local voiceless = "ptʈkɸfsθʃxʦʧʨḱ"
local voiceless = "ptʈkɸfsθʃxʦʧʨḱ"
local consonants = "[" .. voiced .. voiceless .. "ʷː]"
local consonants = "[" .. voiced .. voiceless .. "ʷː]"
local front = "iĭïeêɛɪæyʏøœ"
local front = "iïíĬIÎÍeĕéêɛɪæyʏøœ"
local back = "uoɔʊʌɑɒ"
local back = "uoɔʊʌɑɒ"
local vowels = "[aɐ" .. front .. back .. c.acute .. c.breve .. c.circ .. c.diaer .. "jw]"
local vowels = "[aɐ" .. front .. back .. c.acute .. c.breve .. c.circ .. c.diaer .. "jw]"
Line 49: Line 49:
{"ch", "k"}, {"g([ckqg])", "ŋ%1"},
{"ch", "k"}, {"g([ckqg])", "ŋ%1"},
{"sc([eêiĭïĬIÎÍ])", "ʃ%1"}, {"([^ŋ])c([eêiĭïĬIÎÍ])", "%1ʧ%2"},
{"sc([eêiïIÍ])", "ʃ%1"}, {"([^ŋ])c([eêiïIÍ])", "%1ʧ%2"},
{"g([eêiĭïĬIÎÍ])", "ʤ%1"}, {"gh", "g"},
{"g([eêiïIÍ])", "ʤ%1"}, {"gh", "g"},
{"c", "k"}, {"ŋʤ", "dʤ"}, {"dz", "ʣ"},
{"c", "k"}, {"ŋʤ", "dʤ"}, {"dz", "ʣ"},
{"ŋgü", "gǵ"}, {"gu(" .. vowels .. ")", "ǵ%1"},
{"ŋgü", "gǵ"}, {"gu(" .. vowels .. ")", "ǵ%1"},
{"gl([iĭïĬIÎÍ]?)", "ʎ%1"}, {"gn([iĭïĬIÎÍ]?)", "ɲ%1"},
{"gl([iïIÎÍ]?)", "ʎ%1"}, {"gn([iïIÎÍ]?)", "ɲ%1"},
{"(" .. vowels .. ")([ʣʎɲ])(" .. vowels .. ")", "%1%2%2%3"},
{"(" .. vowels .. ")([ʣʎɲ])(" .. vowels .. ")", "%1%2%2%3"},
Line 71: Line 71:
--{"ʤ", "d͡ʒ"}, {"ʧ", "t͡ʃ"}, {"ʦ", "t͡s"}, {"ʣ", "d͡z"},
--{"ʤ", "d͡ʒ"}, {"ʧ", "t͡ʃ"}, {"ʦ", "t͡s"}, {"ʣ", "d͡z"},
--{"ḱ", "kʷ"}, {"ǵ", "ɡʷ"}, {"ʈ", "t"},
--{"ḱ", "kʷ"}, {"ǵ", "ɡʷ"}, {"ʈ", "t"},
{"I", "i"},
{"·ˈ·", "ˈ"}, {"^ˈ·", "ˈ"}, {"·", "."}
{"·ˈ·", "ˈ"}, {"^ˈ·", "ˈ"}, {"·", "."}
Line 106: Line 108:
local first_stress = "[âêîÎôû" .. c.circ .. "]"
local first_stress = "[âêîÎôû" .. c.circ .. "]"
local second_stress = "[áéíÍóú" .. c.acute .. "]"
local second_stress = "[áéíÍóú" .. c.acute .. "]"
local unstressed = "[ăĕĭĬŏŭ" .. c.breve .. "]"
local unstressed = "[ăĕ" .. c.breve .. "]"
for i, syll in ipairs(syllables) do
for i, syll in ipairs(syllables) do
if match(word, "ˈ") then -- keep looking for secondary stresses but don't apply penultimate rule
if match(word, "ˈ") then -- keep looking for secondary stresses but don't apply penultimate rule
Line 120: Line 122:
syll = "ˌ" .. gsub(mw.ustring.toNFD(syll), c.circ, "")
syll = "ˌ" .. gsub(mw.ustring.toNFD(syll), c.circ, "")
break
break
elseif match(word, "[ɛɔĬIÎÍ]") then
elseif match(word, "[ɛɔIÎÍ]") then
if match(syll, "[ɛɔI]") and not match(syll, unstressed) then
if match(syll, "[ɛɔI]") and not match(syll, unstressed) then
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.acute, "")
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.acute, "")