10,731
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) (Added preposition enclisis table) |
||
Line 2,432: | Line 2,432: | ||
return "<div class=\"noprint maintenance-box maintenance-box-red\" style=\"background:#FFE7DD; width:90%; margin: 0.75em auto; border:1px dashed #884444; padding: 0.25em;\"><table><tr><td rowspan=\"2\">[[File:Nuvola_apps_important_yellow.svg|48px]]</td><th style=\"text-align: left;\">Please review the following stems</th></tr><tr><td>" .. string.char(10) .. table.concat(review, string.char(10)) .. string.char(10) .. "If all is okay, add <code>|check=1</code> to generate the tables.</td></tr></table></div>[[Category:Unchecked Radestrian conjugation tables]]" | return "<div class=\"noprint maintenance-box maintenance-box-red\" style=\"background:#FFE7DD; width:90%; margin: 0.75em auto; border:1px dashed #884444; padding: 0.25em;\"><table><tr><td rowspan=\"2\">[[File:Nuvola_apps_important_yellow.svg|48px]]</td><th style=\"text-align: left;\">Please review the following stems</th></tr><tr><td>" .. string.char(10) .. table.concat(review, string.char(10)) .. string.char(10) .. "If all is okay, add <code>|check=1</code> to generate the tables.</td></tr></table></div>[[Category:Unchecked Radestrian conjugation tables]]" | ||
end | end | ||
end | |||
function export.enclisis(frame) | |||
local m_government = require('Module:government') | |||
local args = getArgs(frame) | |||
local prep = args['entry'] or mw.title.getCurrentTitle().text | |||
local is_para = {entry = true, nocap = true} | |||
local gen = false | |||
local gen_prons = { | |||
{"vesk", "rask", "vâsk", "vask", "dzmes", "dzatus", "sjás", "vjes", "vais", "dzisk", "dzjes"}, | |||
{"bjásk", "bisk", "kú", "okú", "byesk", "busk"}, | |||
{"bjais", "bjes", "tes", "otes", "baus", "bøs"}, | |||
{"vaosk", "utú"} | |||
} | |||
local dat = false | |||
local dat_prons = { | |||
{"ven", "ran", "vân", "van", "dzmen", "dzatun", "sján", "vjen", "vain", "dzin", "dzjen"}, | |||
{"bjá", "bin", "ka", "oka", "bá", "bun"}, | |||
{"bjain", "bjen", "ten", "oten", "baun", "bøn"}, | |||
{"vá", "uva"} | |||
} | |||
local acc = false | |||
local acc_prons = { | |||
{"vest", "rast", "vâst", "vast", "dzmed", "dzatud", "sjád", "vjed", "vaid", "dzist", "dzjed"}, | |||
{"bjást", "bist", "kad", "okad", "byest", "bust"}, | |||
{"bjaid", "bjed", "ted", "oted", "baud", "bød"}, | |||
{"vaost", "utad"} | |||
} | |||
local ins = false | |||
local ins_prons = { | |||
{"vebúr", "rábúr", "vâbúr", "vabúr", "dzmeríe", "dzatoríe", "sjáríe", "víríe", "vairíe", "dzibúr", "dzíríe"}, | |||
{"bjábúr", "bibúr", "kaor", "okúr", "býbúr", "butúr"}, | |||
{"bjairíe", "bjeríe", "teríe", "oteríe", "bauríe", "børíe"}, | |||
{"vaobúr", "ubúr"} | |||
} | |||
local function governs(case) | |||
return m_government.generate({case}) | |||
end | |||
if args[1] == nil then error("There are no cases specified") end | |||
local counter = 1 | |||
while args[counter] do | |||
if args[counter] == "gen" then gen = true | |||
elseif args[counter] == "dat" then dat = true | |||
elseif args[counter] == "acc" then acc = true | |||
elseif args[counter] == "ins" then ins = true | |||
end | |||
counter = counter + 1 | |||
end | |||
local regex_list = {} | |||
for i, _ in pairs(args) do | |||
if is_para[i] ~= true then table.insert(regex_list, i) end | |||
end | |||
table.sort(regex_list, function(a, b) return string.reverse(a) > string.reverse(b) end) | |||
local function process(pronoun) | |||
pronoun = pronoun .. prep | |||
for _, regex in ipairs(regex_list) do | |||
if mw.ustring.match(pronoun, regex .. prep .. "$") then | |||
pronoun = mw.ustring.gsub(pronoun, regex .. prep .. "$", args[regex]) | |||
break | |||
end | |||
end | |||
return pronoun | |||
end | |||
if not args['nocap'] then add("The enclitic form is used in combination with weak pronominal complements:") end | |||
add("<small>") | |||
add("<table class=\"blacklinks mw-collapsible mw-collapsed wikitable inflection table\" style=\"text-align: center\" width=100%>") | |||
tr() | |||
th("Combined pronominal forms of ''" .. prep .. "'' ", 1, 12) | |||
_tr() | |||
th("case", 4) | |||
th("personal", 1, 11) | |||
_tr() | |||
th("<small>SG</small>", 1, 4) | |||
th("<small>PL</small>", 1, 5) | |||
th("<small>REFL</small>", 3) | |||
th("<small>RECP</small>", 3) | |||
_tr() | |||
th("<small>1</small>", 2) | |||
th("<small>2</small>", 2) | |||
th("<small>3</small>", 1, 2) | |||
th("<small>1</small>", 1, 2) | |||
th("<small>2</small>", 2) | |||
th("<small>3</small>", 1, 2) | |||
_tr() | |||
th("<small>ANIM</small>") | |||
th("<small>INAN</small>") | |||
th("<small>INCL</small>") | |||
th("<small>EXCL</small>") | |||
th("<small>ANIM</small>") | |||
th("<small>INAN</small>") | |||
local function list_pers(case, name, set) | |||
if case then | |||
_tr() | |||
th(governs(name)) | |||
for _, j in ipairs(set[1]) do td(rad_link_IPA(process(j))) end | |||
end | |||
end | |||
list_pers(gen, "gen", gen_prons) | |||
list_pers(dat, "dat", dat_prons) | |||
list_pers(acc, "acc", acc_prons) | |||
list_pers(ins, "ins", ins_prons) | |||
-- non-personal pronouns | |||
_tr() | |||
th("case", 3) | |||
th("number", 3) | |||
th("interrogative-<br>existential", 1, 2) | |||
th("demonstrative", 1, 2) | |||
th("quantifier", 1, 6) | |||
_tr() | |||
th("<small>ANIM</small>", 2) | |||
th("<small>INAN</small>", 2) | |||
th("<small>PROX</small>", 2) | |||
th("<small>DIST</small>", 2) | |||
th("indefinite", 1, 2) | |||
th("general indefinite", 1, 2) | |||
th("collective", 1, 2) | |||
_tr() | |||
th("<small>ANIM</small>") | |||
th("<small>INAN</small>") | |||
th("<small>ANIM</small>") | |||
th("<small>INAN</small>") | |||
th("<small>ANIM</small>") | |||
th("<small>INAN</small>") | |||
local function list_nonpers(case, name, set) | |||
if case then | |||
_tr() | |||
th(governs(name), 2) | |||
th("<small>SG</small>") | |||
for _, j in ipairs(set[2]) do | |||
td(rad_link_IPA(process(j))) | |||
end | |||
local q_anim, q_inan = process(set[2][1]), process(set[2][2]) | |||
if mw.ustring.match(q_anim, "[" .. C .. "]$") then td(rad_link_IPA(q_anim .. "-á")) else td(rad_link_IPA(q_anim .. "-vá")) end | |||
if mw.ustring.match(q_inan, "[" .. C .. "]$") then td(rad_link_IPA(q_inan .. "-á")) else td(rad_link_IPA(q_inan .. "-vá")) end | |||
for _, j in ipairs(set[4]) do td(rad_link_IPA(process(j))) end | |||
_tr() | |||
th("<small>PL</small>") | |||
for _, j in ipairs(set[3]) do td(rad_link_IPA(process(j))) end | |||
q_anim, q_inan = process(set[3][1]), process(set[3][2]) | |||
if mw.ustring.match(q_anim, "[" .. C .. "]$") then td(rad_link_IPA(q_anim .. "-á")) else td(rad_link_IPA(q_anim .. "-vá")) end | |||
if mw.ustring.match(q_inan, "[" .. C .. "]$") then td(rad_link_IPA(q_inan .. "-á")) else td(rad_link_IPA(q_inan .. "-vá")) end | |||
th("", 1, 2) | |||
end | |||
end | |||
list_nonpers(gen, "gen", gen_prons) | |||
list_nonpers(dat, "dat", dat_prons) | |||
list_nonpers(acc, "acc", acc_prons) | |||
list_nonpers(ins, "ins", ins_prons) | |||
tr_() | |||
add("</table>") | |||
add("</small>") | |||
return table.concat(format_table, string.char(10)) | |||
end | end | ||