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 = " | local front = "ieɛɪæ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]" | ||
local function dediacv(str) | |||
return gsub(mw.ustring.toNFD(str), "(" .. vowels .. ")[" .. c.diacritics .. "]", "%1") | |||
end | |||
local function laxen(v) | local function laxen(v) | ||
| Line 49: | Line 53: | ||
{"ch", "k"}, {"g([ckqg])", "ŋ%1"}, | {"ch", "k"}, {"g([ckqg])", "ŋ%1"}, | ||
{"sc([ | {"sc([eêĕéiïíî])", "ʃ%1"}, {"([^ŋ])c([eêĕéiïíî])", "%1ʧ%2"}, | ||
{"g([ | {"g([eêĕéiïíî])", "ʤ%1"}, {"gh", "g"}, | ||
{"c", "k"}, {"ŋʤ", "dʤ"}, {"dz", "ʣ"}, | {"c", "k"}, {"ŋʤ", "dʤ"}, {"dz", "ʣ"}, | ||
{"ŋgü", "gǵ"}, {"gu(" .. vowels .. ")", "ǵ%1"}, | {"ŋgü", "gǵ"}, {"gu(" .. vowels .. ")", "ǵ%1"}, | ||
{"gl([ | {"gl([iïíî]?)", "ʎ%1"}, {"gn([iïíî]?)", "ɲ%1"}, | ||
{"(" .. vowels .. ")([ʣʎɲ])(" .. vowels .. ")", "%1%2%2%3"}, | {"(" .. vowels .. ")([ʣʎɲ])(" .. vowels .. ")", "%1%2%2%3"}, | ||
| Line 106: | Line 110: | ||
if #syllables == 1 then return table.concat(syllables) end -- account for monosyllables | if #syllables == 1 then return table.concat(syllables) end -- account for monosyllables | ||
local first_stress = "[ | local first_stress = "[âêîôû]" | ||
local second_stress = "[ | local second_stress = "[áéíóú]" | ||
local unstressed = "[ăĕ | local unstressed = "[ăĕ]" | ||
for i, syll in ipairs(syllables) do | for i, syll in ipairs(syllables) do | ||
if match(syll, first_stress) then | if match(word, first_stress) then | ||
if match(syll, first_stress) then | |||
elseif match(word, "[ | syll = "ˈ" .. dediacv(syll) | ||
if match(syll, "[ | else break end | ||
syll = "ˈ" .. syll | elseif match(word, "a[eu]") or match(word, "ei") then | ||
end | if match(syll, "a[eu]") or match(syll, "ei") then | ||
syll = "ˈ" .. dediacv(syll) | |||
else break end | |||
end | end | ||