Module:xchc-pron: Difference between revisions

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
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 consonantsAsIs = "[мньӈбдгвзжғлрйпткфсшӀчц]"
local vowels = "[ыиэеаяүөуюоёӯӣɜɔ]"
local vowels = "[ыиэеаяүөуюоёӯӣɜɔ]"


Line 123: Line 125:
local exception = (term:match(unrounded) and term:match(rounded)) or (term:match(front) and term:match(back))
local exception = (term:match(unrounded) and term:match(rounded)) or (term:match(front) and term:match(back))
if exception then
if exception then
termR = termR:gsub(neutralR, ""); termB = termB:gsub(neutralB, "")
termR = term:gsub(neutralR, ""); termB = term:gsub(neutralB, "")
termR = termR:match(vowels .. consonants .. "*$"); termB = termB:match(vowels .. consonants .. "*$")
termR = termR:match("(".. vowels .. consonantsAsIs .. "*)$") or termR; termB = termB:match("(" .. vowels .. consonants .. "*)$") or termB
end
end