10,735
edits
TheNightAvl (talk | contribs) mNo edit summary |
TheNightAvl (talk | contribs) mNo edit summary |
||
Line 14: | Line 14: | ||
function add(code) | function add(code) | ||
table.insert(format_table, code) | table.insert(format_table, code) | ||
end | |||
function tr() | |||
table.insert(format_table, "<tr>") | |||
end | |||
function tr_() | |||
table.insert(format_table, "</tr>") | |||
end | end | ||
Line 235: | Line 243: | ||
end | end | ||
tr() | |||
th("", 1, 2) | th("", 1, 2) | ||
th("singular") | th("singular") | ||
th("plural") | th("plural") | ||
tr_() | |||
tr() | |||
th("nominative", 1, 2) | th("nominative", 1, 2) | ||
if nom == nompl then | if nom == nompl then | ||
Line 251: | Line 259: | ||
td(nompl, 2) | td(nompl, 2) | ||
end | end | ||
tr_() | |||
tr() | |||
th("vocative", 1, 2) | th("vocative", 1, 2) | ||
if nom ~= nompl and nom ~= voc then td(voc) end | if nom ~= nompl and nom ~= voc then td(voc) end | ||
tr_() | |||
tr() | |||
th("genitive", 2, 1) | th("genitive", 2, 1) | ||
th("long") | th("long") | ||
td(gen, 2, 1) | td(gen, 2, 1) | ||
td(genpl) | td(genpl) | ||
tr_() | |||
tr() | |||
th("short") | th("short") | ||
td(genpl_short) | td(genpl_short) | ||
tr_() | |||
tr() | |||
th("dative", 1, 2) | th("dative", 1, 2) | ||
td(dat) | td(dat) | ||
td(datpl) | td(datpl) | ||
tr_() | |||
tr() | |||
th("accusative", 1, 2) | th("accusative", 1, 2) | ||
td(acc) | td(acc) | ||
td(accpl) | td(accpl) | ||
tr_() | |||
tr() | |||
th("instrumental", 1, 2) | th("instrumental", 1, 2) | ||
td(ins) | td(ins) | ||
td(inspl) | td(inspl) | ||
tr_() | |||
elseif table_type == "sg" then | elseif table_type == "sg" then | ||
th("Declension of <i>" .. nom_cite .. "</i> (" .. type_name .. ") ", 1, 2) | th("Declension of <i>" .. nom_cite .. "</i> (" .. type_name .. ") ", 1, 2) | ||
tr() | |||
th("") | th("") | ||
th("singular") | th("singular") | ||
tr_() | |||
tr() | |||
th("nominative") | th("nominative") | ||
if nom == voc then td(nom, 2) else td(nom) end | if nom == voc then td(nom, 2) else td(nom) end | ||
tr_() | |||
tr() | |||
th("vocative") | th("vocative") | ||
if nom ~= voc then td(voc) end | if nom ~= voc then td(voc) end | ||
tr_() | |||
tr() | |||
th("genitive") | th("genitive") | ||
td(gen) | td(gen) | ||
tr_() | |||
tr() | |||
th("dative") | th("dative") | ||
td(dat) | td(dat) | ||
tr_() | |||
tr() | |||
th("accusative") | th("accusative") | ||
td(acc) | td(acc) | ||
tr_() | |||
tr() | |||
th("instrumental") | th("instrumental") | ||
td(ins) | td(ins) | ||
tr_() | |||
elseif table_type == "pl" then | elseif table_type == "pl" then | ||
th("Declension of <i>" .. nompl_cite .. "</i> (" .. type_name .. ") ", 1, 3) | th("Declension of <i>" .. nompl_cite .. "</i> (" .. type_name .. ") ", 1, 3) | ||
tr() | |||
th("", 1, 2) | th("", 1, 2) | ||
th("plural") | th("plural") | ||
tr_() | |||
tr() | |||
th("nominative", 1, 2) | th("nominative", 1, 2) | ||
td(nompl, 2) | td(nompl, 2) | ||
tr_() | |||
tr() | |||
th("vocative", 1, 2) | th("vocative", 1, 2) | ||
tr_() | |||
tr() | |||
th("genitive", 2, 1) | th("genitive", 2, 1) | ||
th("long") | th("long") | ||
td(genpl) | td(genpl) | ||
tr_() | |||
tr() | |||
th("short") | th("short") | ||
td(genpl_short) | td(genpl_short) | ||
tr_() | |||
tr() | |||
th("dative", 1, 2) | th("dative", 1, 2) | ||
td(datpl) | td(datpl) | ||
tr_() | |||
tr() | |||
th("accusative", 1, 2) | th("accusative", 1, 2) | ||
td(accpl) | td(accpl) | ||
tr_() | |||
tr() | |||
th("instrumental", 1, 2) | th("instrumental", 1, 2) | ||
td(inspl) | td(inspl) | ||
tr_() | |||
elseif table_type == "du" then | elseif table_type == "du" then | ||
th("Declension of <i>" .. nom_cite .. "</i> (" .. type_name .. ") ", 1, 5) | th("Declension of <i>" .. nom_cite .. "</i> (" .. type_name .. ") ", 1, 5) | ||
tr() | |||
th("", 2, 2) | th("", 2, 2) | ||
th("singular", 2, 1) | th("singular", 2, 1) | ||
th("plural", 1, 2) | th("plural", 1, 2) | ||
tr_() | |||
tr() | |||
th("binary") | th("binary") | ||
th("true") | th("true") | ||
tr_() | |||
tr() | |||
th("nominative", 1, 2) | th("nominative", 1, 2) | ||
if nom == voc then td(nom, 2) else td(nom) end | if nom == voc then td(nom, 2) else td(nom) end | ||
td(nomdu, 2) | td(nomdu, 2) | ||
td(nompl, 2) | td(nompl, 2) | ||
tr_() | |||
tr() | |||
th("vocative", 1, 2) | th("vocative", 1, 2) | ||
if nom ~= voc then td(voc) end | if nom ~= voc then td(voc) end | ||
tr_() | |||
tr() | |||
th("genitive", 2, 1) | th("genitive", 2, 1) | ||
th("long") | th("long") | ||
Line 372: | Line 380: | ||
td(gendu) | td(gendu) | ||
td(genpl) | td(genpl) | ||
tr_() | |||
tr() | |||
th("short") | th("short") | ||
td(gendu_short) | td(gendu_short) | ||
td(genpl_short) | td(genpl_short) | ||
tr_() | |||
tr() | |||
th("dative", 1, 2) | th("dative", 1, 2) | ||
td(dat) | td(dat) | ||
td(datdu) | td(datdu) | ||
td(datpl) | td(datpl) | ||
tr_() | |||
tr() | |||
th("accusative", 1, 2) | th("accusative", 1, 2) | ||
td(acc) | td(acc) | ||
td(accdu) | td(accdu) | ||
td(accpl) | td(accpl) | ||
tr_() | |||
tr() | |||
th("instrumental", 1, 2) | th("instrumental", 1, 2) | ||
td(ins) | td(ins) | ||
td(insdu) | td(insdu) | ||
td(inspl) | td(inspl) | ||
tr_() | |||
elseif table_type == "dupl" then | elseif table_type == "dupl" then | ||
th("Declension of <i>" .. nomdu_cite .. "</i> (" .. type_name .. ") ", 1, 3) | th("Declension of <i>" .. nomdu_cite .. "</i> (" .. type_name .. ") ", 1, 3) | ||
tr() | |||
th("", 1, 2) | th("", 1, 2) | ||
th("binary plural") | th("binary plural") | ||
tr_() | |||
tr() | |||
th("nominative", 1, 2) | th("nominative", 1, 2) | ||
td(nomdu, 2) | td(nomdu, 2) | ||
tr_() | |||
tr() | |||
th("vocative", 1, 2) | th("vocative", 1, 2) | ||
tr_() | |||
tr() | |||
th("genitive", 2, 1) | th("genitive", 2, 1) | ||
th("long") | th("long") | ||
td(gendu) | td(gendu) | ||
tr_() | |||
tr() | |||
th("short") | th("short") | ||
td(gendu_short) | td(gendu_short) | ||
tr_() | |||
tr() | |||
th("dative", 1, 2) | th("dative", 1, 2) | ||
td(datdu) | td(datdu) | ||
tr_() | |||
tr() | |||
th("accusative", 1, 2) | th("accusative", 1, 2) | ||
td(accdu) | td(accdu) | ||
tr_() | |||
tr() | |||
th("instrumental", 1, 2) | th("instrumental", 1, 2) | ||
td(insdu) | td(insdu) | ||
tr_() | |||
end | end | ||
add("</table>") | add("</table>") | ||
Line 450: | Line 458: | ||
local args = getArgs(frame) | local args = getArgs(frame) | ||
local pp = m_stem.getVerbStem(args) | local pp = m_stem.getVerbStem(args) | ||
mw.logObject(pp) | |||
format_table = {} | |||
if (args["t"] == "tr" or args["t"] == "pass") and args[6] == nil and args[7] == nil then error("Passive conjugation tables require arguments 6 (infinitive) and 7 (present participle stem).") end | |||
add("<small>") | |||
add("<table class=\"mw-collapsible mw-collapsed wikitable inflection table\" width=100% style=\"text-align: center\">") | |||
tr() | |||
th("Conjugation of ''" .. pp.inf .. "'' (active voice) ", 1, 14) | |||
tr_() | |||
add("</table>") | |||
add("</small") | |||
return table.concat(format_table, string.char(10)) | |||
end | end | ||
Line 461: | Line 479: | ||
Debug console test string: | Debug console test string: | ||
=p.show(mw.getCurrentFrame():newChild{title="whatever",args={"hv", "o~u^u", "þ"}}) | =p.show(mw.getCurrentFrame():newChild{title="whatever",args={"hv", "o~u^u", "þ"}}) | ||
=p.conjugate(mw.getCurrentFrame():newChild{title="whatever",args={"deat","de",["1s"]="dei",["3s"]="deaș",["pl"]="di","diș","deti","dev"}}) | |||
]]-- | ]]-- |