10,794
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) No edit summary |
||
Line 1,890: | Line 1,890: | ||
return nil | return nil | ||
end | end | ||
local C_regex = "szlntdrmpbθðhjwçfvʃʒxŋkɡɲ%." | |||
local V_long_regex = "[uyiɔœɛoɤeaæø][uyiɔœɛoɤeaæøː][ːeoi]?" | |||
local V_short_regex = "[uyiɔœɛɤa]([^ːaeoiu])" | |||
IPA = mw.ustring.match(IPA, "[^ˈˌ]+$") | IPA = mw.ustring.match(IPA, "[^ˈˌ]+$") | ||
IPA = mw.ustring.gsub(IPA, "^[" .. C_regex .. "]+", "") -- delete consonant cluster | |||
IPA = mw.ustring.gsub(IPA, "^[ | IPA = mw.ustring.gsub(IPA, "^".. V_long_regex, "") -- delete long vowel | ||
IPA = mw.ustring.gsub(IPA, "^" .. V_short_regex, "%1") -- delete short vowel | |||
IPA = mw.ustring.gsub(IPA, "^ | IPA = mw.ustring.gsub(IPA, "^[" .. C_regex .. "]+", "") -- delete consonant cluster | ||
if mw.ustring.find(IPA, "^".. V_long_regex) then return nil end | |||
IPA = mw.ustring.gsub(IPA, "^ | |||
IPA = mw.ustring.gsub(IPA, "^[ | |||
if mw.ustring.find(IPA, "^ | |||
while true do | while true do | ||
if mw.ustring.find(IPA, "^ | if mw.ustring.find(IPA, "^".. V_long_regex) or mw.ustring.find(IPA, "^[uyiɔœɛɤa][" .. C_regex .. "]*$") then | ||
break | break | ||
else | else | ||
IPA = mw.ustring.gsub(IPA, "^ | IPA = mw.ustring.gsub(IPA, "^" .. V_short_regex, "%1") -- delete short vowel | ||
IPA = mw.ustring.gsub(IPA, "^[" .. C_regex .. "]+", "") -- delete consonant cluster | |||
IPA = mw.ustring.gsub(IPA, "^[ | |||
end | end | ||
end | end |