Module:rad-IPA: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
No edit summary
Line 1,899: Line 1,899:
IPA = mw.ustring.gsub(IPA, "^[" .. C_regex .. "]+", "") -- delete consonant cluster
IPA = mw.ustring.gsub(IPA, "^[" .. C_regex .. "]+", "") -- delete consonant cluster
if mw.ustring.find(IPA, "^".. V_long_regex) or mw.ustring.find(IPA, "^[uyiɔœɛɤa][" .. C_regex .. "]*$") then return nil end
if mw.ustring.find(IPA, "^".. V_long_regex) or mw.ustring.find(IPA, "^[uyiɔœɛɤa][" .. C_regex .. "]*$") then return nil end
local IPA_rhymes = {}


while true do
while true do
if mw.ustring.find(IPA, "^".. V_long_regex) or mw.ustring.find(IPA, "^[uyiɔœɛɤa][" .. C_regex .. "]*$") then
if mw.ustring.find(IPA, "^".. V_long_regex .. "[" .. C_regex .. "]+" .. V_short_regex) or mw.ustring.find(IPA, "^".. V_long_regex .. "[" .. C_regex .. "]+[uyiɔœɛɤa][" .. C_regex .. "]*$") then
table.insert(IPA_rhymes, IPA)
IPA = mw.ustring.gsub(IPA, "^".. V_long_regex, "") -- delete long vowel
elseif mw.ustring.find(IPA, "^".. V_long_regex) or mw.ustring.find(IPA, "^[uyiɔœɛɤa][" .. C_regex .. "]*$") then
table.insert(IPA_rhymes, IPA)
break
break
else
else
Line 1,909: Line 1,915:
end
end
return IPA
return IPA_rhymes
end
end


Navigation menu