Module:mg-pron: Difference between revisions
Created page with "local sub = mw.ustring.sub local find = mw.ustring.find local match = mw.ustring.match local gmatch = mw.ustring.gmatch local gsub = mw.ustring.gsub local u = mw.ustring.char..." |
No edit summary |
||
| Line 9: | Line 9: | ||
local NASAL = u(0x0303) -- COMBINING TILDE, ̃ | local NASAL = u(0x0303) -- COMBINING TILDE, ̃ | ||
local velar = "[kɡɫ]" | |||
local consonants = "[bkdhjlmnɲprɾstʃθβðɡɣzʧɫʎ]" | |||
local vowels = "[aeiou]" | |||
local function same(foo, bar) | local function same(foo, bar) | ||
| Line 17: | Line 21: | ||
local export = {} | local export = {} | ||
local prelims = { | |||
{"r", "ɾ"}, {"ch", "ʧ"}, {"qu", "k"}, {"il", "ʎ"}, {"ñ", "ɲ"}, | |||
} | |||
local rules = { | local rules = { | ||
{"([ɾs])([ɾs])", function(s1, s2) return same(s1, s2) and "ʰ%1" or s1 .. s2 end}, | |||
{".$", {["a"] = "ɐ", ["e"] = "ɪ", ["o"] = "ʊ", --[[["n"] = NASAL]]}} | {".$", {["a"] = "ɐ", ["e"] = "ɪ", ["o"] = "ʊ", --[[["n"] = NASAL]]}} | ||
} | } | ||
local function syllabify(term) | |||
end | |||
function export.crux(term) | function export.crux(term) | ||
term = mw.ustring.lower(term) | term = mw.ustring.lower(term) | ||
for _, repl in ipairs(prelims) do | |||
term = gsub(term, repl[1], repl[2]) | |||
end | |||
term = syllabify(term) | |||
for _, rule in ipairs(rules) do | for _, rule in ipairs(rules) do | ||