Module:lumb-conj: Difference between revisions

Nehster9 (talk | contribs)
No edit summary
Nehster9 (talk | contribs)
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
-- Gollic verb module
-- Lumbaieric verb module
local p = {}
local p = {}


Line 36: Line 36:
     fut_1p = "ōnha",
     fut_1p = "ōnha",
     fut_2p = "ōnta",
     fut_2p = "ōnta",
     fut_3p = "őnahþa",
     fut_3p = "ōnahþa",


     Spres_1s = "uit",
     Spres_1s = "er",
     Spres_2s = "ans",
     Spres_2s = "īt",
     Spres_3s = "oix",
     Spres_3s = "jōt",
     Spres_1p = "ue",
     Spres_1p = "era",
     Spres_2p = "anse",
     Spres_2p = "īta",
     Spres_3p = "oie",
     Spres_3p = "jōta",


     Simperf_1s = "et",
     Simperf_1s = "au",
     Simperf_2s = "ou",
     Simperf_2s = "ōfla",
     Simperf_3s = "t",
     Simperf_3s = "in",
     Simperf_1p = "ue",
     Simperf_1p = "awa",
     Simperf_2p = "ue",
     Simperf_2p = "ōfla",
     Simperf_3p = "e",
     Simperf_3p = "ina",


     IMP_2s = "s",
     IMP_2s = "s",
     IMP_1p = "ue",
     IMP_3s = "erþ",
     IMP_2p = "se"
     IMP_2p = "sa",
    IMP_3p = "erþa",
}
}


Line 62: Line 63:


local irregulars = {
local irregulars = {
["vuitaine"] = {
["berijana"] = {
pres_part = "vine",
fut_1s = "skrōgijōna",
pres_1s = "v'yé",
    fut_2s = "skrōgijōnt",
pres_2s = "v'yét",
    fut_3s = "skrōgijōnahþ",
pres_3s = "vuis",
    fut_1p = "skrōgijōnha",
pres_2p = "v'yée",
    fut_2p = "skrōgijōnta",
pres_3p = "vuise",
    fut_3p = "skrōgijōnahþa",
imperf_2s = "vuis",
   
imperf_2p = "vuise",
    past_1s = "pākīr",
past_1s = "vuir",
    past_2s = "pākīnt",
past_2s = "vind",
    past_3s = "pākīþ",
past_3s = "vuit",
    past_1p = "pākīra",
past_1p = "vuire",
    past_2p = "pākīnta",
past_2p = "vind",
    past_3p = "pākīþa",
past_3p = "vuite",
    past_part = "pākijar",
fut_1s = "v'yan",
fut_2s = "v'yand",
fut_3s = "v'yant",
fut_1p = "v'yance",
fut_2p = "v'yandé",
fut_3p = "v'yante",
Spres_1s = "vuit",
Spres_2s = "v'yans",
Spres_2p = "v'yanse",
Simperf_1s = "vuit",
}
}
}
}
Line 133: Line 124:
     -- double h is simplified to single h
     -- double h is simplified to single h
     form = mw.ustring.gsub(form, "hh", "h")
     form = mw.ustring.gsub(form, "hh", "h")
   
    -- double j is simplified to single j
    form = mw.ustring.gsub(form, "jj", "j")
   
    -- <iji> is simplified to <ī>
    form = mw.ustring.gsub(form, "ij[iī]", "ī")


     return form
     return form
Line 147: Line 144:


     local stem = get_stem(title)
     local stem = get_stem(title)
    local root = args.root


     local use_oi = (args.oi and args.oi ~= "" and args.oi ~= "0")
     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 159: 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


-- STEM ALTERNATION
local rootPart = root
if use_oi then
local suffixPart = ""
    local oi_slots = {
 
        pres_1s = true,
if rootPart then
        pres_2s = true,
suffixPart = mw.ustring.sub(stem, mw.ustring.len(rootPart) + 1)
        pres_3s = true,
end
        imperf_3s = true,
 
        past_1s = true,
-- STRONG VERBS
        past_2s = true,
if strong and strong_classes[strong] then
        past_3s = true,
 
        Simperf_2s = true,
    local grade
         IMP_2s = true
 
    }
    if mw.ustring.match(slot, "^past_") then
         grade = strong_classes[strong].past


     if oi_slots[slot] then
     elseif mw.ustring.match(slot, "^fut_") then
         currentStem = mw.ustring.gsub(currentStem, "e", "oi")
        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 185: 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 193: Line 228:


     table.insert(t,
     table.insert(t,
        '{| class="wikitable mw-collapsible mw-collapsed"\n'
    '{| class="wikitable mw-collapsible mw-collapsed"\n'
        .. '|+ Conjugation of [[Contionary:' .. title .. '|' .. title .. ']]\n'
    .. '|+ Conjugation of [[Contionary:' .. title .. '|' .. title .. ']]'
    )
    .. conjugation_type .. '\n'
)


     table.insert(t,
     table.insert(t,
Line 229: Line 265:
     .. '! rowspan="5" style="background:#bbd0fa;" | Indicative\n'
     .. '! rowspan="5" style="background:#bbd0fa;" | Indicative\n'
     .. '! \n'
     .. '! \n'
     .. '! ' .. make_pronoun("vie")
     .. '! ' .. make_pronoun("")
     .. ' !! ' .. make_pronoun("tife")
     .. ' !! ' .. make_pronoun("þifuz")
     .. ' !! ' .. make_pronoun("vois/liv/ceu")
     .. ' !! ' .. make_pronoun("wēs/liu/heu")
     .. ' !! ' .. make_pronoun("vié")
     .. ' !! ' .. make_pronoun("wīa")
     .. ' !! ' .. make_pronoun("tifée")
     .. ' !! ' .. make_pronoun("þifuza")
     .. ' !! ' .. make_pronoun("voise")
     .. ' !! ' .. make_pronoun("wēza")
     .. '\n'
     .. '\n'
     )
     )
Line 292: Line 328:
     .. '! rowspan="3" style="background:#b3da9d;" | Subjunctive\n'
     .. '! rowspan="3" style="background:#b3da9d;" | Subjunctive\n'
     .. '! \n'
     .. '! \n'
     .. '! ' .. make_pronoun("vie")
     .. '! ' .. make_pronoun("")
     .. ' !! ' .. make_pronoun("tife")
     .. ' !! ' .. make_pronoun("þifuz")
     .. ' !! ' .. make_pronoun("vois/liv/ceu")
     .. ' !! ' .. make_pronoun("wēs/liu/heu")
     .. ' !! ' .. make_pronoun("vié")
     .. ' !! ' .. make_pronoun("wīa")
     .. ' !! ' .. make_pronoun("tifée")
     .. ' !! ' .. make_pronoun("þifuza")
     .. ' !! ' .. make_pronoun("voise")
     .. ' !! ' .. make_pronoun("wēza")
     .. '\n'
     .. '\n'
     )
     )
Line 332: Line 368:
     .. '! \n'
     .. '! \n'
     .. '! —'
     .. '! —'
     .. ' !! ' .. make_pronoun("tife")
     .. ' !! ' .. make_pronoun("þifuz")
    .. ' !! —'
     .. ' !! ' .. make_pronoun("wēs/liu/heu")
    .. ' !! ' .. make_pronoun("vié")
     .. ' !! ' .. make_pronoun("tifée")
     .. ' !! —'
     .. ' !! —'
    .. ' !! ' .. make_pronoun("þifuza")
    .. ' !! ' .. make_pronoun("wēza")
     .. '\n'
     .. '\n'
     )
     )
Line 345: Line 381:
     .. '| ' .. empty_cell()
     .. '| ' .. empty_cell()
     .. ' || ' .. make_cell(forms.IMP_2s)
     .. ' || ' .. make_cell(forms.IMP_2s)
    .. ' || ' .. make_cell(forms.IMP_3s)
     .. ' || ' .. empty_cell()
     .. ' || ' .. empty_cell()
    .. ' || ' .. make_cell(forms.IMP_1p)
     .. ' || ' .. make_cell(forms.IMP_2p)
     .. ' || ' .. make_cell(forms.IMP_2p)
     .. ' || ' .. empty_cell()
     .. ' || ' .. make_cell(forms.IMP_3p)
     .. '\n'
     .. '\n'
     )
     )
Line 357: Line 393:
     .. '| ' .. empty_cell()
     .. '| ' .. empty_cell()
     .. ' || ' .. make_cell(forms.IMP_2s, "ne")
     .. ' || ' .. make_cell(forms.IMP_2s, "ne")
    .. ' || ' .. make_cell(forms.IMP_3s, "ne")
     .. ' || ' .. empty_cell()
     .. ' || ' .. empty_cell()
    .. ' || ' .. make_cell(forms.IMP_1p, "ne")
     .. ' || ' .. make_cell(forms.IMP_2p, "ne")
     .. ' || ' .. make_cell(forms.IMP_2p, "ne")
     .. ' || ' .. empty_cell()
     .. ' || ' .. make_cell(forms.IMP_3p, "ne")
     .. '\n'
     .. '\n'
     )
     )
Line 366: 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