Module:xchc-pron: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 17: Line 17:
local nb_cons = "mnŋɲptbdkɡfvszʃʒxɣhʧʦʤʣlrɾʎ"
local nb_cons = "mnŋɲptbdkɡfvszʃʒxɣhʧʦʤʣlrɾʎ"
local consonants = "[" .. nb_cons .. "]"
local consonants = "[" .. nb_cons .. "]"
local vowels = "[ыиэеаяүөуюоёӯӣɜɔ]"


local export = {}
local export = {}
Line 114: Line 115:
function export.harmony(term)
function export.harmony(term)
term = export.simplify(term)
term = export.simplify(term)
--[[local ret = {
local termR, termB = term, term
["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",
local unrounded = "[ыиӣеэ]"; local rounded = "[үөуӯюоё]"; local neutralR = "[ɛɔая]"
["backness"] = term:match("э") and "f" or term:match("о" .. c.macron .. "?" .. c.breve) and "b" or "ab",
local front = "ɛ"; local back = "ɔ"; local neutralB = "[ыиӣеэүөуӯюоёая]"
}]]
 
-- for words that violate vowel harmony (compounds and loanwords)
local exception = (term:match(unrounded) and term:match(rounded)) or (term:match(front) and term:match(back))
if exception then
termR = term:gsub(neutralR, ""); termB = term:gsub(neutralB, "")
termR = termR:match(vowels .. consonants .. "*$"); termB = termB:match(vowels .. consonants .. "*$")
end
local ret = {
local ret = {
["roundness"] = term:match("[ыиӣеэ]") and "u" or term:match("[үөуӯюоё]") and "r" or "ar",
["roundness"] = termR:match(unrounded) and "u" or termR:match(rounded) and "r" or "ar",
["backness"] = term:match("ɜ") and "f" or term:match("ɔ") and "b" or "ab",
["backness"] = termB:match(front) and "f" or termB:match(back) and "b" or "ab",
}
}
return ret
return ret

Navigation menu