Module:xchc-pron: Difference between revisions

Jump to navigation Jump to search
Undo revision 474002 by Sware (talk)
No edit summary
(Undo revision 474002 by Sware (talk))
Line 108: Line 108:
{"(" .. consonants .. ")([iyeø])", "%1ʲ%2"},
{"(" .. consonants .. ")([iyeø])", "%1ʲ%2"},
}
}
-- Remove diacritics for module calculations based on vowels
function export.simplify(term)
term = mw.usting.toNFD(term):gsub(c.macron, "") -- vowel length
term = term:gsub("э" .. c.breve, "ɛ"); term = term:gsub("о" .. c.breve, "ɔ")
term = mw.ustring.toNFC(term):gsub("ё", "о"); term = term:gsub("е" .. c.diaer, "о")
return term
end


function export.crux(term)
function export.crux(term)
Line 122: Line 131:


function export.harmony(term)
function export.harmony(term)
term = export.simplify(term)
--[[local ret = {
["roundness"] = ((not term:match("о" .. c.macron .. "?" .. c.breve) and term:match("[үуӯюөоё]")) or term:match("е" .. c.macron .. c.diaer)) and "r"
or term:match("[ыиӣэе]") and "u" or "ar",
["backness"] = term:match("э") and "f" or term:match("о" .. c.macron .. "?" .. c.breve) and "b" or "ab",
}]]
local ret = {
local ret = {
["roundness"] = ((not term:match("о%W?%W") and term:match("[үуӯюөоё]")) or term:match("е%W%W")) and "r"
["roundness"] = term:match("[ыиӣеэ]") and "u" or term:match("[үөуӯюоё]") and "r" or "ar",
or term:match("[ыиӣэе]") and "u" or "ar",
["backness"] = term:match("ɜ") and "f" or term:match("ɔ") and "b" or "ab",
["backness"] = term:match("э") and "f" or term:match("о%W?%W") and "b" or "ab",
}
}
return ret
return ret

Navigation menu