Module:lumb-conj: Difference between revisions
mNo edit summary |
No edit summary |
||
| (11 intermediate revisions by the same user not shown) | |||
| Line 36: | Line 36: | ||
fut_1p = "ōnha", | fut_1p = "ōnha", | ||
fut_2p = "ōnta", | fut_2p = "ōnta", | ||
fut_3p = " | fut_3p = "ōnahþa", | ||
Spres_1s = "er", | Spres_1s = "er", | ||
| Line 63: | Line 63: | ||
local irregulars = { | local irregulars = { | ||
[""] = { | ["berijana"] = { | ||
fut_1s = "skrōgijōna", | |||
fut_2s = "skrōgijōnt", | |||
fut_3s = "skrōgijōnahþ", | |||
fut_1p = "skrōgijōnha", | |||
fut_2p = "skrōgijōnta", | |||
fut_3p = "skrōgijōnahþa", | |||
past_1s = "pākīr", | |||
past_2s = "pākīnt", | |||
past_3s = "pākīþ", | |||
past_1p = "pākīra", | |||
past_2p = "pākīnta", | |||
past_3p = "pākīþa", | |||
past_part = "pākijar", | |||
} | } | ||
} | } | ||
| Line 114: | Line 127: | ||
-- double j is simplified to single j | -- double j is simplified to single j | ||
form = mw.ustring.gsub(form, "jj", "j") | form = mw.ustring.gsub(form, "jj", "j") | ||
-- <iji> is simplified to <ī> | |||
form = mw.ustring.gsub(form, "ij[iī]", "ī") | |||
return form | return form | ||
| Line 128: | Line 144: | ||
local stem = get_stem(title) | local stem = get_stem(title) | ||
local root = args.root | |||
local | local strong = args.strong | ||
local strong_classes = { | |||
a = { | |||
past = "ū", | |||
future = "ō", | |||
}, | |||
e = { | |||
past = "ā", | |||
future = "i", | |||
}, | |||
} | |||
local strong_categories = { | |||
a = "Lumbaieric class 1 strong verbs", | |||
e = "Lumbaieric class 2 strong verbs", | |||
} | |||
local forms = {} | local forms = {} | ||
local used_irregular = false | |||
for slot, ending in pairs(endings) do | for slot, ending in pairs(endings) do | ||
| Line 140: | Line 175: | ||
elseif irregulars[title] and irregulars[title][slot] then | elseif irregulars[title] and irregulars[title][slot] then | ||
forms[slot] = irregulars[title][slot] | forms[slot] = irregulars[title][slot] | ||
used_irregular = true | |||
else | else | ||
local currentStem = stem | local currentStem = stem | ||
local rootPart = root | |||
if | local suffixPart = "" | ||
if rootPart then | |||
suffixPart = mw.ustring.sub(stem, mw.ustring.len(rootPart) + 1) | |||
end | |||
-- STRONG VERBS | |||
if strong and strong_classes[strong] then | |||
local grade | |||
if mw.ustring.match(slot, "^past_") then | |||
grade = strong_classes[strong].past | |||
elseif mw.ustring.match(slot, "^fut_") then | |||
currentStem = mw.ustring.gsub(currentStem, " | grade = strong_classes[strong].future | ||
end | |||
if grade then | |||
if rootPart then | |||
rootPart = mw.ustring.gsub(rootPart, "a", grade) | |||
currentStem = rootPart .. suffixPart | |||
else | |||
currentStem = mw.ustring.gsub(currentStem, "a", grade) | |||
end | |||
end | end | ||
end | end | ||
| Line 166: | Line 212: | ||
end | end | ||
end | end | ||
local conjugation_type | |||
if strong_categories[strong] then | |||
conjugation_type = " (strong class " .. strong_categories[strong]:match("class (%d+)") .. ")" | |||
else | |||
conjugation_type = " (weak)" | |||
end | |||
---------------------------------------------------------------- | ---------------------------------------------------------------- | ||
| Line 174: | Line 228: | ||
table.insert(t, | table.insert(t, | ||
'{| class="wikitable mw-collapsible mw-collapsed"\n' | |||
.. '|+ Conjugation of [[Contionary:' .. title .. '|' .. title .. ']]' | |||
.. conjugation_type .. '\n' | |||
) | |||
table.insert(t, | table.insert(t, | ||
| Line 210: | Line 265: | ||
.. '! rowspan="5" style="background:#bbd0fa;" | Indicative\n' | .. '! rowspan="5" style="background:#bbd0fa;" | Indicative\n' | ||
.. '! \n' | .. '! \n' | ||
.. '! ' .. make_pronoun(" | .. '! ' .. make_pronoun("wī") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("þifuz") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("wēs/liu/heu") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("wīa") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("þifuza") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("wēza") | ||
.. '\n' | .. '\n' | ||
) | ) | ||
| Line 273: | Line 328: | ||
.. '! rowspan="3" style="background:#b3da9d;" | Subjunctive\n' | .. '! rowspan="3" style="background:#b3da9d;" | Subjunctive\n' | ||
.. '! \n' | .. '! \n' | ||
.. '! ' .. make_pronoun(" | .. '! ' .. make_pronoun("wī") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("þifuz") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("wēs/liu/heu") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("wīa") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("þifuza") | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("wēza") | ||
.. '\n' | .. '\n' | ||
) | ) | ||
| Line 313: | Line 368: | ||
.. '! \n' | .. '! \n' | ||
.. '! —' | .. '! —' | ||
.. ' !! ' .. make_pronoun(" | .. ' !! ' .. make_pronoun("þifuz") | ||
.. ' !! ' .. make_pronoun("wēs/liu/heu") | |||
.. ' !! ' .. make_pronoun(" | |||
.. ' !! —' | .. ' !! —' | ||
.. ' !! ' .. make_pronoun("þifuza") | |||
.. ' !! ' .. make_pronoun("wēza") | |||
.. '\n' | .. '\n' | ||
) | ) | ||
| Line 347: | Line 402: | ||
table.insert(t, '|}') | table.insert(t, '|}') | ||
return table.concat(t) | if strong_categories[strong] then | ||
table.insert(t, | |||
"\n[[Category:" .. strong_categories[strong] .. "]]") | |||
else | |||
table.insert(t, | |||
"\n[[Category:Lumbaieric weak verbs]]") | |||
end | |||
if used_irregular then | |||
table.insert(t, | |||
"\n[[Category:Lumbaieric irregular verbs]]") | |||
end | |||
return table.concat(t) | |||
end | end | ||
return p | return p | ||