Module:kilta-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14: Line 14:
local m_IPA = require("Module:IPA")
local m_IPA = require("Module:IPA")


local consonants = "[pβmtsnɾlʧkxʷʞƕᵷʤɡbvdː]"
local consonants = "[pβmtsnɾlʧkxʷqƕᵷʤɡbvdː]"
local vowels = "[aeiouəꜷꜽː]"
local vowels = "[aeiouəꜷꜽː]"


Line 27: Line 27:
local phonemic_rules = {
local phonemic_rules = {
{"%-$", ""}, {"%-", " "},
{"%-$", ""}, {"%-", " "},
{"hw", "ƕ"}, {"kw", "ʞ"}, {"ch", "ʧ"}, {"au", "ꜷ"}, {"ai", "ꜽ"},
{"hw", "ƕ"}, {"kw", "q"}, {"ch", "ʧ"}, {"au", "ꜷ"}, {"ai", "ꜽ"},
{"v", "β"}, {"r", "ɾ"}, {"h", "x"},
{"v", "β"}, {"r", "ɾ"}, {"h", "x"},
{"ë", "ə"}, {"ëë+", "əː"}, {"([áéíóú])", function(v) return mw.ustring.toNFD(v):gsub(A, "ː") end},
{"ë", "ə"}, {"ëë+", "əː"}, {"([áéíóú])", function(v) return mw.ustring.toNFD(v):gsub(A, "ː") end},
{"", "ʞː"}, {"(" .. consonants .. ")(" .. consonants .. ")",
{"kq", ""}, {"(" .. consonants .. ")(" .. consonants .. ")",
function(c1,c2) return same(c1,c2) and c1 .. "ː" or c1 .. c2 end},
function(c1,c2) return same(c1,c2) and c1 .. "ː" or c1 .. c2 end},
}
}
Line 38: Line 38:
local phonetic_rules = {
local phonetic_rules = {
{"a(ː?·?ˈ?)([nm])", "æ%1%2"},
{"a(ː?·?ˈ?)([nm])", "æ%1%2"},
{"n(ː?·?ˈ?)([kxʞƕ])", "ŋ%1%2"},
{"n(ː?·?ˈ?)([kxqƕ])", "ŋ%1%2"},
{"([nm])·k", "%1·ɡ"}, {"([nm])·ʞ", "%1·ᵷ"}, {"([nm])·p", "%1·b"}, {"([nm])·ʧ", "%1·ʤ"},
{"([nm])·k", "%1·ɡ"}, {"([nm])·q", "%1·ᵷ"}, {"([nm])·p", "%1·b"}, {"([nm])·ʧ", "%1·ʤ"},
{"([nm])·t", "%1·d"},  
{"([nm])·t", "%1·d"},  
{"([nm])(ː?·?ˈ?)β", "%1%2b"},
{"([nm])(ː?·?ˈ?)β", "%1%2b"},
Line 47: Line 47:


local last_rules = {
local last_rules = {
{"ʞ", "kʷ"}, {"ƕ", "xʷ"}, {"ᵷ", "ɡʷ"},
{"q", "kʷ"}, {"ƕ", "xʷ"}, {"ᵷ", "ɡʷ"},
{"ʧ", "t͡ʃ"},
{"ʧ", "t͡ʃ"},
{"ʤ", "d͡ʒ"},
{"ʤ", "d͡ʒ"},
Line 64: Line 64:
term = term:gsub("·+", "·")
term = term:gsub("·+", "·")
term = term:gsub("·([nlɾs])([pβmtʧkxʷʞƕː])", "%1·%2")
term = term:gsub("·([nlɾs])([pβmtʧkxʷqƕː])", "%1·%2")
term = term:gsub("·([tmnlɾs])$", "%1")
term = term:gsub("·([tmnlɾs])$", "%1")
term = term:gsub("·(" .. consonants .. ")·", "%1·")
term = term:gsub("·(" .. consonants .. ")·", "%1·")