10,731
edits
TheNightAvl (talk | contribs) mNo edit summary |
TheNightAvl (talk | contribs) mNo edit summary |
||
Line 29: | Line 29: | ||
mw.log("——— Processing arguments ———") | mw.log("——— Processing arguments ———") | ||
while args_frame[p] do | |||
table.insert(args, args_frame[p]) | |||
mw.log("Argument " .. p .. ": " .. args_frame[p]) | |||
p = p + 1 | |||
end | |||
-- All possible "modes": | -- All possible "modes": | ||
Line 79: | Line 79: | ||
local working_syllables = "" | local working_syllables = "" | ||
for i = 1, #args do | if #args > 0 and args ~= nil then | ||
for i = 1, #args do | |||
mw.log("Processing argument " .. i .. ".") | |||
if parameter[args[i]] ~= nil then -- mode changer | |||
mode = args[i] | |||
mode_dialect = "standard" | |||
mode_register = "plain" | |||
elseif dialect[args[i]] ~= nil then | |||
mode_dialect = args[i] | |||
mode_register = "plain" | |||
elseif register[args[i]] ~= nil then | |||
mode_register = args[i] | |||
-- begin adding data to tables -- | |||
elseif mode == "IPA" then | |||
if args[i] == "no auto" then | |||
IPA_no_auto = true | |||
else | |||
table.insert(IPA[mode_dialect][mode_register], args[i]) | |||
mw.log("IPA: added '" .. args[i] .. "' to IPA[" .. mode_dialect .. "][" .. mode_register .. "]") | |||
if mode_dialect == "standard" or mode_dialect == "hjádvanþs" then | |||
local just_phonemic = mw.ustring.match(args[i], "%/(.*)%/") | |||
insert_rhyme(just_phonemic) | |||
end | |||
end | end | ||
elseif mode == "syllables" then | |||
if args[i] == "no auto" then | |||
syllables_no_auto = true | |||
elseif args[i] == "" then | |||
if mw.ustring.find(working_syllables, "(%|)") then | |||
if mw.ustring.find(working_syllables, "(%|)") then | table.insert(syllables, working_syllables) | ||
mw.log("Syllables: " .. working_syllables .. " registered.") | |||
end | |||
working_syllables = "" | |||
elseif args[i+1] == nil then | |||
working_syllables = working_syllables .. "|" .. args[i] | |||
if mw.ustring.find(working_syllables, "(%|)") then | |||
table.insert(syllables, working_syllables) | |||
mw.log("Syllables: " .. working_syllables .. " registered.") | |||
end | |||
else | |||
working_syllables = working_syllables .. "|" .. args[i] | |||
end | end | ||
elseif mode == "homophones" then | |||
elseif | table.insert(homophones, args[i]) | ||
mw.log("Homophones: " .. args[i] .. " registered.") | |||
end | end | ||
end | end | ||
end | end | ||
-- add auto values -- | -- add auto values -- | ||
if IPA_no_auto == false then | if IPA_no_auto == false then |