48,406
edits
No edit summary |
No edit summary |
||
| Line 70: | Line 70: | ||
for i, word in ipairs(words) do | for i, word in ipairs(words) do | ||
word = gsub(word, "(" .. consonants .. "*)(" .. vowels .. "+)(" .. consonants .. "*)", "%1%2·%3") | word = gsub(word, "(" .. consonants .. "*)(" .. vowels .. "+)(" .. consonants .. "*)", "%1%2·%3") | ||
word = | word = gsub(word, "·(" .. consonants .. "?)$", "%1") | ||
word = gsub(word, "·(" .. consonants .. ")(" .. consonants .. "+)", "%1·%2") | |||
word = gsub(word, "(" .. consonants .. ")·%1", "·%1%1") | |||
words[i] = word | words[i] = word | ||
| Line 86: | Line 88: | ||
-- default to short lax vowels | -- default to short lax vowels | ||
term = | term = gsub(term, "[aeiouy]", laxen); term = gsub(term, "ů", "œ") | ||
-- long vowels | -- long vowels | ||
local nfd_term = mw.ustring.toNFD(term) | local nfd_term = mw.ustring.toNFD(term) | ||
nfd_term = | nfd_term = gsub(nfd_term, "([aeiouy])" .. c.hook, function(v) | ||
return long_vowels[v] or long_vowels[v .. c.hook] | return long_vowels[v] or long_vowels[v .. c.hook] | ||
end) | end) | ||
term = mw.ustring.toNFC(nfd_term) | term = mw.ustring.toNFC(nfd_term) | ||
term = | term = gsub(term, "ɔɑ", "ɑː"); term = gsub(term, "ɛœ", "øː") | ||
-- diphthongized vowels | -- diphthongized vowels | ||
term = | term = gsub(term, "ʊɔ", "ʊu"); term = gsub(term, "œɑ", "øy"); term = gsub(term, "œɛ", "ʏy") | ||
-- labiodiphthongized vowels | -- labiodiphthongized vowels | ||
term = | term = gsub(term, "vʏy", "ᶣy"); term = gsub(term, "vøy", "ᶣø"); term = gsub(term, "vʊu", "ʷu") -- different in eastern | ||
term = | term = gsub(term, "^ᶣ", "ɥ"); term = gsub(term, "^ʷ", "w") | ||
-- diphthongs | -- diphthongs | ||
term = | term = gsub(term, "([ɛɑ])ʏ", "%1y"); term = gsub(term, "ɑy", "æy") | ||
term = | term = gsub(term, "([ɛɑɪ]ʊ)", "%1u"); term = gsub(term, "ɪœ", "ɪy") | ||
-- simple consonant subtitutions | -- simple consonant subtitutions | ||
term = | term = gsub(term, "ṡ", "ʃ") | ||
term = | term = gsub(term, "ḷ", "ɬ"); term = gsub(term, "ḥ", "ʔ"); | ||
-- geminate consonants | -- geminate consonants | ||
term = | term = gsub(term, "(.)%1", "%1ː"); term = gsub(term, "ng", "ŋː") | ||
-- final substitutions | -- final substitutions | ||
| Line 121: | Line 123: | ||
} | } | ||
term = | term = gsub(term, "[ʧʦgƛṃṇṛ]", final_subs) | ||
return term | return term | ||