Module:taln-conj: Difference between revisions
mNo edit summary |
m Sware moved page Module:tln-conj to Module:taln-conj without leaving a redirect |
||
| (19 intermediate revisions by one other user not shown) | |||
| Line 14: | Line 14: | ||
pres_3p = "ᠠᠨ", | pres_3p = "ᠠᠨ", | ||
imperf_1s = " | imperf_1s = "ᠠᠨ", | ||
imperf_2s = " | imperf_2s = "ᠠᠰ", | ||
imperf_3s = " | imperf_3s = "ᠠᠲ", | ||
imperf_1p = " | imperf_1p = "ᠠᠨᠤᠰ", | ||
imperf_2p = " | imperf_2p = "ᠠᠵᠢᠰ", | ||
imperf_3p = " | imperf_3p = "ᠠᠨ", | ||
past_1s = "ᠠᠢ", | past_1s = "ᠠᠢ", | ||
| Line 45: | Line 45: | ||
pres_3p = "ᠡᠨ", | pres_3p = "ᠡᠨ", | ||
imperf_1s = " | imperf_1s = "ᠠᠨ", | ||
imperf_2s = " | imperf_2s = "ᠠᠰ", | ||
imperf_3s = " | imperf_3s = "ᠠᠲ", | ||
imperf_1p = " | imperf_1p = "ᠠᠨᠤᠰ", | ||
imperf_2p = " | imperf_2p = "ᠠᠵᠢᠰ", | ||
imperf_3p = " | imperf_3p = "ᠠᠨ", | ||
past_1s = "ᠢ", | past_1s = "ᠢ", | ||
| Line 63: | Line 63: | ||
fut_3s = "ᠡᠷᠡᠲ", | fut_3s = "ᠡᠷᠡᠲ", | ||
fut_1p = "ᠡᠷᠡᠨᠤᠰ", | fut_1p = "ᠡᠷᠡᠨᠤᠰ", | ||
fut_2p = " | fut_2p = "ᠡᠷᠡᠵᠢᠰ", | ||
fut_3p = "ᠡᠷᠡᠨ" | fut_3p = "ᠡᠷᠡᠨ" | ||
}, | }, | ||
ire = { | ire = { | ||
pres_1s = " | pres_1s = "ᠣ", | ||
pres_2s = " | pres_2s = "ᠢᠰ", | ||
pres_3s = " | pres_3s = "ᠢᠲ", | ||
pres_1p = " | pres_1p = "ᠢᠨᠤᠰ", | ||
pres_2p = " | pres_2p = "ᠢᠵᠢᠰ", | ||
pres_3p = " | pres_3p = "ᠢᠤᠨ", | ||
imperf_1s = " | imperf_1s = "ᠢᠠᠨ", | ||
imperf_2s = " | imperf_2s = "ᠢᠠᠰ", | ||
imperf_3s = " | imperf_3s = "ᠢᠠᠲ", | ||
imperf_1p = " | imperf_1p = "ᠢᠠᠨᠤᠰ", | ||
imperf_2p = " | imperf_2p = "ᠢᠠᠵᠢᠰ", | ||
imperf_3p = " | imperf_3p = "ᠢᠠᠨ", | ||
past_1s = " | past_1s = "ᠢ", | ||
past_2s = " | past_2s = "ᠢᠰᠲᠢ", | ||
past_3s = " | past_3s = "ᠢᠲ", | ||
past_1p = " | past_1p = "ᠢᠨᠤᠰ", | ||
past_2p = " | past_2p = "ᠢᠰᠲᠢᠰ", | ||
past_3p = " | past_3p = "ᠢᠡᠷᠤᠨ", | ||
fut_1s = " | fut_1s = "ᠢᠷᠢᠣ", | ||
fut_2s = " | fut_2s = "ᠢᠷᠡᠰ", | ||
fut_3s = " | fut_3s = "ᠢᠷᠡᠲ", | ||
fut_1p = " | fut_1p = "ᠢᠷᠡᠨᠤᠰ", | ||
fut_2p = " | fut_2p = "ᠢᠷᠡᠵᠢᠰ", | ||
fut_3p = " | fut_3p = "ᠢᠷᠡᠨ" | ||
} | } | ||
} | |||
---------------------------------------------------------------- | |||
-- IRREGULAR VERBS | |||
---------------------------------------------------------------- | |||
local irregulars = { | |||
["ᠢᠷᠡ"] = { | |||
pres_1s = "ᠸᠣ", | |||
pres_2s = "ᠸᠠᠢᠰ", | |||
pres_3s = "ᠸᠠᠢᠲ", | |||
pres_1p = "ᠸᠠᠢᠨᠤᠰ", | |||
pres_2p = "ᠸᠠᠢᠰ", | |||
pres_3p = "ᠸᠣᠨ", | |||
past_1s = "ᠣᠯᠠᠢ", | |||
past_2s = "ᠣᠯᠠᠢᠰᠲᠢ", | |||
past_3s = "ᠣᠯᠠᠢᠲ", | |||
past_1p = "ᠣᠯᠠᠢᠨᠤᠰ", | |||
past_2p = "ᠣᠯᠠᠢᠰᠲᠢᠰ", | |||
past_3p = "ᠣᠯᠡᠷᠤᠨ" | |||
} | |||
} | } | ||
| Line 141: | Line 166: | ||
["ᠨ"] = "n", | ["ᠨ"] = "n", | ||
["ᠴ"] = "č", | ["ᠴ"] = "č", | ||
["ᠶ"] = "y" | ["ᠶ"] = "y", | ||
["ᠳ"] = "d", | |||
["ᠯ"] = "l" | |||
} | } | ||
| Line 158: | Line 185: | ||
local function make_cell(form) | local function make_cell(form) | ||
return "<div style='text-align:center;'>" | return "<div style='text-align:center;'>" | ||
.. "[[" .. form .. "]]" | .. "[[Contionary:" .. form .. "|" .. form .. "]]" | ||
.. "<br /><span style='color:#777777; font-size:90%;'>" | .. "<br /><span style='color:#777777; font-size:90%;'>" | ||
.. romanize(form) | .. romanize(form) | ||
.. "</span></div>" | .. "</span></div>" | ||
end | |||
local function combine(stem, ending) | |||
if mw.ustring.match(stem, "ᠶ$") and | |||
mw.ustring.match(ending, "^ᠢ") then | |||
ending = mw.ustring.gsub(ending, "^ᠢ", "ᠡ") | |||
end | |||
return stem .. ending | |||
end | end | ||
| Line 182: | Line 220: | ||
local forms = {} | local forms = {} | ||
local function get_slot_stem(args, slot) | |||
if args[ | |||
local parts = mw.text.split(slot, "_") | |||
local mood = nil | |||
local tense = nil | |||
local person_number = nil | |||
-- Detect capital prefix = mood (your convention) | |||
if mw.ustring.match(parts[1], "^[A-Z]") then | |||
mood = parts[1] | |||
tense = parts[2] | |||
person_number = parts[3] | |||
else | |||
tense = parts[1] | |||
person_number = parts[2] | |||
end | |||
local person = person_number:sub(1,1) | |||
local number = person_number:sub(2,2) | |||
-- priority list (MOST specific → LEAST specific) | |||
local candidates = {} | |||
if mood then | |||
table.insert(candidates, mood .. "_" .. tense .. "_" .. person_number .. "_stem") | |||
table.insert(candidates, mood .. "_" .. tense .. "_" .. person .. "_stem") | |||
table.insert(candidates, mood .. "_" .. tense .. "_" .. number .. "_stem") | |||
table.insert(candidates, mood .. "_" .. tense .. "_stem") | |||
table.insert(candidates, mood .. "_stem") | |||
end | |||
table.insert(candidates, tense .. "_" .. person_number .. "_stem") | |||
table.insert(candidates, tense .. "_" .. person .. "_stem") | |||
table.insert(candidates, tense .. "_" .. number .. "_stem") | |||
table.insert(candidates, tense .. "_stem") | |||
table.insert(candidates, "stem") | |||
for _, key in ipairs(candidates) do | |||
if args[key] and args[key] ~= "" then | |||
return args[key] | |||
end | end | ||
end | end | ||
return stem | |||
end | |||
for slot, ending in pairs(endings[class]) do | |||
if args[slot] and args[slot] ~= "" then | |||
forms[slot] = args[slot] | |||
elseif irregulars[title] | |||
and irregulars[title][slot] then | |||
forms[slot] = irregulars[title][slot] | |||
else | |||
forms[slot] = combine(stem, ending) | |||
end | |||
end | |||
local text = | local text = | ||
'{| class="wikitable mw-collapsible mw-collapsed"\n' | '{| class="wikitable mw-collapsible mw-collapsed"\n' | ||
.. '|+ Conjugation of [[' .. title .. ']] (<span style="color:#777777;">' .. romanize(title) .. '</span>)\n' | .. '|+ Conjugation of [[Contionary:' .. title .. '|' .. title .. ']] (<span style="color:#777777;">' .. romanize(title) .. '</span>)\n' | ||
---------------------------------------------------------------- | ---------------------------------------------------------------- | ||