10,731
edits
TheNightAvl (talk | contribs) mNo edit summary |
TheNightAvl (talk | contribs) mNo edit summary |
||
Line 19: | Line 19: | ||
function export.show(frame) | function export.show(frame) | ||
local | local args = getArgs(frame) | ||
local word = mw.title.getCurrentTitle().subpageText | local word = mw.title.getCurrentTitle().subpageText | ||
local p = 1 | local p = 1 | ||
if | if args["entry"] ~= nil then | ||
word = | word = args["entry"] | ||
end | end | ||
Line 79: | Line 71: | ||
local working_syllables = "" | local working_syllables = "" | ||
local i = 1 | |||
while args[i] 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 | ||
elseif mode == "syllables" then | 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 | |||
table.insert(syllables, working_syllables) | |||
mw.log("Syllables: " .. working_syllables .. " registered.") | |||
end | end | ||
elseif | 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 | |||
table.insert(homophones, args[i]) | |||
mw.log("Homophones: " .. args[i] .. " registered.") | |||
end | end | ||
i = i + 1 | |||
end | end | ||
i = nil | |||
-- add auto values -- | -- add auto values -- | ||
if IPA_no_auto == false then | if IPA_no_auto == false then |