48,406
edits
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 termR, termB = term, term | |||
local unrounded = "[ыиӣеэ]"; local rounded = "[үөуӯюоё]"; local neutralR = "[ɛɔая]" | |||
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"] = | ["roundness"] = termR:match(unrounded) and "u" or termR:match(rounded) and "r" or "ar", | ||
["backness"] = | ["backness"] = termB:match(front) and "f" or termB:match(back) and "b" or "ab", | ||
} | } | ||
return ret | return ret | ||