Module:zm-pron: Difference between revisions

no edit summary
(added other allophones)
No edit summary
 
(65 intermediate revisions by 2 users not shown)
Line 7: Line 7:
local split = mw.text.split
local split = mw.text.split
local gsplit = mw.text.gsplit
local gsplit = mw.text.gsplit


-- To avoid weird annoying cursor behavior
-- To avoid weird annoying cursor behavior
Line 15: Line 16:
local AFFR = u(0x0361) -- COMBINING DOUBLE INVERTED BREVE ͡
local AFFR = u(0x0361) -- COMBINING DOUBLE INVERTED BREVE ͡


local back_vowel = "aouɔ"
local back_vowel = "aouɔǫō"
local front_vowel = "ieɛ"
local front_vowel = "ieɛɪ"
local vowels = "[" .. back_vowel .. front_vowel .. "]"
local vowels = "[" .. back_vowel .. front_vowel .. "]"
local acuted = "[áéíóúÉÓ]"
local acuted = "[áéíóúýÉÓ]"
local palatal = "[ʨjʎʃʒʥʤʧʦʣ]"
local oral = "áéíóúýÉÓaouɔieɛ"
local palatal = "[ʨjʎʃʒʥʤʧʦʣɕʑ]"
local sonorant = "[rl]"
local sonorant = "[rl]"
local plosives = "[ptkbdg]"
local velar = "[ɡkx]"
local velar = "[ɡkx]"
local consonants = "[mnptkbdɡfvszxrljɲŋʋʎʨjʎʃʒʥʤʧʤʣʦ]"
local consonants = "[mnptkbdɡfvszxrljɲŋʋʎʨjʎʃʒʥʤʧʤʣʦɕʑ]"


local export = {}
local export = {}


local rules = {
local rules = {
{"ai", "ɛ"}, {"aí", "É"}, {"au", "ɔ"}, {"aú", "Ó"}, {"è", "ɛ"}, {"ò", "ɔ"},
{"ai", "ɛ"}, {"aí", "É"}, {"au", "ɔ"}, {"aú", "Ó"}, {"è", "ɛ"}, {"ò", "ɔ"}, {"y", "ɪ"},
{"dź", "ʥ"}, {"dž", "ʤ"}, {"c", "ʦ"}, {"ć", "ʨ"}, {"nj", "ɲ"}, {"č", "ʧ"}, {"ž", "ʒ"},  {"š", "ʃ"},  {"lj", "ʎ"},
{"dź", "ʥ"}, {"dž", "ʤ"}, {"c", "ʦ"}, {"ć", "ʨ"}, {"nj", "ɲ"}, {"č", "ʧ"}, {"ž", "ʒ"},  {"š", "ʃ"},  {"lj", "ʎ"},
{"h", "x"}, {"g", "ɡ"},
{"h", "x"}, {"g", "ɡ"}, {"ǫ", "o"}, {"ō", "o"}, {"sč", "ʃt͡ʃ"}, {"ou", "u"}, {"ś", "ɕ"}, {"ź", "ʑ"},
{"(" .. vowels .. ")[lv]$", "%1ʋ"}, {"(" .. acuted .. ")[lv]$", "%1ʋ"},
{"(" .. vowels .. ")[lv]$", "%1ʋ"}, {"(" .. acuted .. ")[lv]$", "%1ʋ"},
{"(" .. consonants ..")([])(" .. consonants ..")", "%1(ə)%2" .. SYLL .. "%3"}, {"(" .. consonants ..")r$", "%1ər"},
{"(" .. plosives .. ")[ptkbdg]$", "[ptkbdg]"},
{"(" .. vowels .. ")([ptk])(" .. vowels .. ")", "%1%2ʰ%3"}, {"n(" .. velar .. ")", "ŋ%1"},
{"pt" , "t"}, {"pk" , "k"}, {"tp" , "p"}, {"tk" , "k"}, {"kp" , "p"}, {"kt" , "t"},
{"bd" , "d"}, {"bg" , "g"}, {"db" , "b"}, {"dg" , "g"}, {"gb" , "b"}, {"gd" , "d"},
{"(" .. consonants ..")([rŕ])(" .. consonants ..")", "%1ə%2" .. SYLL .. "%3"}, {"(" .. consonants ..")r$", "%1ər"},
{"n(" .. velar .. ")", "ŋ%1"},
{"p(" .. vowels .. ")", "pʰ%1"}, {"t(" .. vowels .. ")", "tʰ%1"}, {"k(" .. vowels .. ")", "kʰ%1"},
{"p(" .. acuted .. ")", "pʰ%1"}, {"t(" .. acuted .. ")", "tʰ%1"}, {"k(" .. acuted .. ")", "kʰ%1"},
{"(" .. palatal .. ")e", "%1ɛ"}, {"(" .. palatal .. ")é", "%1É"},
{"(" .. palatal .. ")e", "%1ɛ"}, {"(" .. palatal .. ")é", "%1É"},
{"(" .. palatal .. ")o", "%1ɔ"}, {"(" .. palatal .. ")ó", "%1Ó"},
{"(" .. palatal .. ")o", "%1ɔ"}, {"(" .. palatal .. ")ó", "%1Ó"},
{"É", "ɛ" .. ACUTE}, {"Ó", "ɔ" .. ACUTE},
{"É", "ɛ" .. ACUTE}, {"Ó", "ɔ" .. ACUTE}, {"ý", "ɪ" .. ACUTE},
}
}


Line 55: Line 64:
if d == "c" then term = gsub(term, "ʨ", "ʧ"); term = gsub(term, "ʥ", "ʤ") end
if d == "c" then term = gsub(term, "ʨ", "ʧ"); term = gsub(term, "ʥ", "ʤ") end
if d == "s" then term = gsub(term, "ʨ", "ʦ"); term = gsub(term, "ʥ", "ʣ") end
if d == "s" then term = gsub(term, "ʨ", "ʦ"); term = gsub(term, "ʥ", "ʣ"); term = gsub(term, "ʰ", "") end
if d == "s" then term = gsub(term, "aj", "ɛː"); term =gsub(term, "ej", "ɛː") end
if d == "c" then term = gsub(term, "aj", "ɛː"); term =gsub(term, "ej", "ɛː") end
if d == "c" then term = gsub(term, "a", "ɐ"); term = gsub(term, "e", "ɪ"); term = gsub(term, "i", "ɪ"); term = gsub(term, "o", "ɔ"); term = gsub(term, "u", "ʊ")  end
if d == "s" then term = gsub(term, "a", "ɐ"); term = gsub(term, "e", "ɛ"); term = gsub(term, "i", "e"); term = gsub(term, "o", "ɔ"); term = gsub(term, "u", "o"); term = gsub(term, "ɪ", "i"); term = gsub(term, "ɪ́", "í"); term = gsub(term, "ų", "u")  end
if d == "n" then term = gsub(term, "a", "ə"); term = gsub(term, "e", "ə"); term = gsub(term, "i", "y"); term = gsub(term, "o", "ɔ"); term = gsub(term, "u", "ʊ"); term = gsub(term, "ɪ", "ɨ"); term = gsub(term, "ɪ́", "ɨ́"); term = gsub(term, "y", "ɪ")  end
 
for _, aff in ipairs(affricates) do
for _, aff in ipairs(affricates) do
Line 63: Line 78:
return term
return term
end
end


function IPA_span(items)
function IPA_span(items)
Line 106: Line 122:
if export.crux(term, "c") ~= export.crux(term) then
if export.crux(term, "c") ~= export.crux(term) then
ipa = ipa .. "\n* "
ipa = ipa .. "\n* "
ipa = ipa .. line_format(separate_word(term, "c"), {'Central'})
ipa = ipa .. line_format(separate_word(term, "n"), {'Northern'})
end
end
if export.crux(term, "s") ~= export.crux(term) then
if export.crux(term, "s") ~= export.crux(term) then
ipa = ipa .. "\n* "
ipa = ipa .. line_format(separate_word(term, "c"), {'Central'})
end
if export.crux(term, "n") ~= export.crux(term) then
ipa = ipa .. "\n* "
ipa = ipa .. "\n* "
ipa = ipa .. line_format(separate_word(term, "s"), {'Southern'})
ipa = ipa .. line_format(separate_word(term, "s"), {'Southern'})
455

edits