Module:rad-pronunciation: Difference between revisions

Added automatic affix recognition to turn off rhyme display
m (Changed delimiter)
(Added automatic affix recognition to turn off rhyme display)
Line 70: Line 70:
local mode_register = "plain"
local mode_register = "plain"
local working_syllables = ""
local working_syllables = ""
-- turn off rhymes if affix
if mw.ustring.find(word, "^[%-·]") or mw.ustring.find(word, "[%-·]$") then
show_rhymes = false
end
local i = 1
local i = 1
Line 75: Line 80:
while args[i] ~= nil or args[i+1] ~= nil do
while args[i] ~= nil or args[i+1] ~= nil do
mw.log("Processing argument " .. i .. ".")
mw.log("Processing argument " .. i .. ".")
if args[i] == "no rhyme" or args[i] == "norhyme" or args[i] == "no rhymes" or args[i] == "norhymes" then
if parameter[args[i]] ~= nil then -- mode changer
show_rhymes = false
elseif parameter[args[i]] ~= nil then -- mode changer
mode = args[i]
mode = args[i]
mode_dialect = "standard"
mode_dialect = "standard"