模組:Et-verbs

維基詞典,自由的多語言詞典


local m_utilities = require("Module:utilities")
local m_links = require("Module:links")

local lang = require("Module:languages").getByCode("et")

local export = {}

-- Functions that do the actual inflecting by creating the forms of a basic term.
local inflections = {}

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	local infl_type = frame.args[1] or error("Inflection type has not been specified. Please pass parameter 1 to the module invocation")
	local args = frame:getParent().args
	
	if not inflections[infl_type] then
		error("Unknown inflection type '" .. infl_type .. "'")
	end
	
	local data = {forms = {}, title = nil, categories = {}}
	
	-- Generate the forms
	inflections[infl_type](args, data)
	
	-- Postprocess
	postprocess(args, data)
	
	if args["type"] then
		table.insert(data.categories, "et-conj with type")
	end
	
	return make_table(data) .. m_utilities.format_categories(data.categories, lang)
end

-- Get parameters from the template, in standard order and numbering
local function get_params(args, num)
	local params = {}
	
	if num == 4 then
		params.base = args[1] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{1}}}"); if not params.base or params.base == "" then error("Parameter 1 (base stem) may not be empty.") end
		params.strong = args[2] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{2}}}") or ""
		params.weak = args[3] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{3}}}") or ""
		params.final = args[4] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{4}}}"); if not params.final or params.final == "" then error("Parameter 4 (final letter(s)) may not be empty.") end
	elseif num == 3 then
		params.base = args[1] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{1}}}"); if not params.base or params.base == "" then error("Parameter 1 (base stem) may not be empty.") end
		params.strong = args[2] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{2}}}") or ""
		params.weak = args[3] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{3}}}") or ""
	elseif num == 1 then
		params.base = args[1] or (mw.title.getCurrentTitle().nsText == "Template" and "{{{1}}}"); if not params.base or params.base == "" then error("Parameter 1 (base stem) may not be empty.") end
	end
	
	return params
end

-- Inflection functions

local stem_endings = {}

stem_endings["ma_inf"] = {
	["ma_inf"] = "ma",
	["ma_inf_ine"] = "mas",
	["ma_inf_ela"] = "mast",
	["ma_inf_tra"] = "maks",
	["ma_inf_abe"] = "mata",
	["quot"] = "vat",
}

stem_endings["da_inf"] = {
	["da_inf"] = "a",
	["des_inf"] = "es",
}

stem_endings["pres"] = {
	["pres_1sg"] = "n",
	["pres_2sg"] = "d",
	["pres_3sg"] = "b",
	["pres_1pl"] = "me",
	["pres_2pl"] = "te",
	["pres_3pl"] = "vad",
	["pres_conn"] = "",
	
	["cond_1sg"] = "ksin",
	["cond_2sg"] = "ksid",
	["cond_3sg"] = "ks",
	["cond_1pl"] = "ksime",
	["cond_2pl"] = "ksite",
	["cond_3pl"] = "ksid",
	["cond_conn"] = "ks",
	
	["impr_2sg"] = "",
}

stem_endings["past"] = {
	["past_1sg"] = "n",
	["past_2sg"] = "d",
	["past_1pl"] = "me",
	["past_2pl"] = "te",
	["past_3pl"] = "d",
}

stem_endings["past_3sg"] = {
	["past_3sg"] = "",
}

stem_endings["impr"] = {
	["impr_3sg"] = "u",
	["impr_1pl"] = "em",
	["impr_2pl"] = "e",
	["impr_3pl"] = "u",
}

stem_endings["pres_part"] = {
	["pres_part"] = "v",
}

stem_endings["past_part"] = {
	--["cond_perf_1sg"] = "uksin",
	--["cond_perf_2sg"] = "uksid",
	--["cond_perf_3sg"] = "uks",
	--["cond_perf_1pl"] = "uksime",
	--["cond_perf_2pl"] = "uksite",
	--["cond_perf_3pl"] = "uksid",
	["past_part"] = "ud",
}

stem_endings["pres_pasv"] = {
	["pres_pasv"] = "akse",
}

stem_endings["past_pasv_part"] = {
	["pres_pasv_conn"] = "a",
	["past_pasv"] = "i",
	["cond_pasv"] = "aks",
	["cond_pasv_conn"] = "aks",
	["impr_pasv"] = "agu",
	["quot_pasv"] = "avat",
	
	["ma_inf_pasv"] = "ama",
		
	["pres_pasv_part"] = "av",
	["past_pasv_part"] = "ud",
}


local function process_stems(data, stems)
	-- Go through each of the stems given
	for stem_key, substems in pairs(stems) do
		for _, stem in ipairs(substems) do
			-- Attach the endings to the stem
			for form_key, ending in pairs(stem_endings[stem_key]) do
				if not data.forms[form_key] then
					data.forms[form_key] = {}
				end
				
				table.insert(data.forms[form_key], stem .. ending)
			end
		end
	end
end


inflections["elama"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|27/elama]],無層級變化"
	table.insert(data.categories, lang:getCanonicalName() .. "elama-類動詞")
	
	local params = get_params(args, 1)
	
	if mw.ustring.find(params.base, "`") then
		require("Module:debug").track("et-verbs/`")
	end
	
	local pres_pasv_stem = ""
	local past_pasv_part_stem = ""
	local past_part_stem = ""
	
	if params.base == "kaitse" then
		pres_pasv_stem = "kaitst"
		past_pasv_part_stem = "kaitst"
		past_part_stem = "kaitsn"
	else 
		pres_pasv_stem = params.base .. "t"
		past_pasv_part_stem = params.base .. "t"
		past_part_stem = params.base .. "n"
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base}
	stems["da_inf"]         = {params.base .. "d"}
	stems["pres"]           = {params.base}
	stems["past"]           = {params.base .. "si"}
	stems["past_3sg"]       = {params.base .. "s"}
	stems["impr"]           = {params.base .. "g"}
	stems["pres_part"]      = {params.base}
	stems["past_part"]      = {past_part_stem}
	stems["pres_pasv"]      = {pres_pasv_stem}
	stems["past_pasv_part"] = {past_pasv_part_stem}
	
	process_stems(data, stems)
end

inflections["õppima"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|28/õppima]]"
	table.insert(data.categories, lang:getCanonicalName() .. "õppima-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	
	local weak_stem
	local passive_stem
	local past_stem
	
	weak_stem = params.base .. params.weak .. params.final
	
	--handles verbs with irregular weak stems
	if params.weak == "" then
		if mw.ustring.find(params.base, "u$") and params.final == "e" then
			-- lugema
			weak_stem = mw.ustring.gsub(params.base, "u$", "o") .. "e"
		elseif mw.ustring.find(params.base, "i$") and params.final == "u" then
			-- siduma
			weak_stem = mw.ustring.gsub(params.base, "i$", "e") .. "o"
		elseif mw.ustring.find(params.base, "a$") and params.final == "u" then
			-- kaduma
			weak_stem = params.base .. "o"
		elseif mw.ustring.find(params.base, "e$") and params.final == "a" then
			-- vedama
			passive_stem = params.base .. "e"
		elseif mw.ustring.find(params.base, "i$") and params.final == "a" then
			-- pidama
			weak_stem = mw.ustring.gsub(params.base, "i$", "e") .. "a"
			passive_stem = mw.ustring.gsub(params.base, "i$", "e") .. "e"
		end
	end
	
	if not passive_stem then
		passive_stem = weak_stem
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong .. params.final}
	stems["da_inf"]         = {params.base .. params.strong .. params.final .. "d"}
	stems["pres"]           = {weak_stem}
	stems["past"]           = {params.base .. params.strong .. params.final .. "si"}
	stems["past_3sg"]       = {params.base .. params.strong .. params.final .. "s"}
	stems["impr"]           = {params.base .. params.strong .. params.final .. "g"}
	stems["pres_part"]      = {params.base .. params.strong .. params.final}
	stems["past_part"]      = {params.base .. params.strong .. params.final .. "n"}
	stems["pres_pasv"]      = {passive_stem .. "t"}
	stems["past_pasv_part"] = {passive_stem .. "t"}
	
	process_stems(data, stems)
end

inflections["nägema"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|28h/nägema]], ''g-ø'' gradation"
	table.insert(data.categories, lang:getCanonicalName() .. "nägema-類動詞")
	
	local params = get_params(args, 1)
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. "ge"}
	stems["da_inf"]         = {params.base .. "h"}
	stems["pres"]           = {params.base .. "e"}
	stems["past"]           = {params.base .. "gi"}
	stems["past_3sg"]       = {params.base .. "gi"}
	stems["impr"]           = {params.base .. "hk"}
	stems["pres_part"]      = {params.base .. "ge"}
	stems["past_part"]      = {params.base .. "in"}
	stems["pres_pasv"]      = {params.base .. "h"}
	stems["past_pasv_part"] = {params.base .. "ht"}
	
	process_stems(data, stems)
end

inflections["hüppama"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|29/hüppama]]"
	table.insert(data.categories, lang:getCanonicalName() .. "hüppama-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ", ''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong .. params.final}
	stems["da_inf"]         = {params.base .. params.weak .. params.final .. "t"}
	stems["pres"]           = {params.base .. params.strong .. params.final}
	stems["past"]           = {params.base .. params.strong .. params.final .. "si"}
	stems["past_3sg"]       = {params.base .. params.strong .. params.final .. "s"}
	stems["impr"]           = {params.base .. params.weak .. params.final .. "k"}
	stems["pres_part"]      = {params.base .. params.strong .. params.final}
	stems["past_part"]      = {params.base .. params.weak .. params.final .. "n"}
	stems["pres_pasv"]      = {params.base .. params.weak .. params.final .. "t"}
	stems["past_pasv_part"] = {params.base .. params.weak .. params.final .. "t"}
	
	process_stems(data, stems)
end

inflections["vaidlema"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|30/vaidlema]]"
	table.insert(data.categories, lang:getCanonicalName() .. "vaidlema-類動詞")
	
	local params = get_params(args, 3)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local weak_stem = params.base .. params.weak .. "e"
	
	-- Temporary, only handles ütlema for now
	if params.weak == "" then
		if mw.ustring.find(params.base, "ü$") then
			weak_stem = mw.ustring.gsub(params.base, "ü$", "ö") .. "e"
		end
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong .. "le"}
	stems["da_inf"]         = {weak_stem .. "ld"}
	stems["pres"]           = {params.base .. params.strong .. "le"}
	stems["past"]           = {params.base .. params.strong .. "lesi"}
	stems["past_3sg"]       = {params.base .. params.strong .. "les"}
	stems["impr"]           = {weak_stem .. "lg"}
	stems["pres_part"]      = {params.base .. params.strong .. "le"}
	stems["past_part"]      = {weak_stem .. "ln"}
	stems["pres_pasv"]      = {weak_stem .. "ld"}
	stems["past_pasv_part"] = {weak_stem .. "ld"}
	
	process_stems(data, stems)
end

inflections["rabelema"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|31/rabelema]],無層級變化"
	table.insert(data.categories, lang:getCanonicalName() .. "rabelema-類動詞")
	
	local params = get_params(args, 1)
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. "ele"}
	stems["da_inf"]         = {params.base .. "eld"}
	stems["pres"]           = {params.base .. "ele"}
	stems["past"]           = {params.base .. "elesi"}
	stems["past_3sg"]       = {params.base .. "eles"}
	stems["impr"]           = {params.base .. "elg"}
	stems["pres_part"]      = {params.base .. "ele"}
	stems["past_part"]      = {params.base .. "eln"}
	stems["pres_pasv"]      = {params.base .. "eld"}
	stems["past_pasv_part"] = {params.base .. "eld"}
	
	process_stems(data, stems)
end

inflections["seisma"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|32/seisma]]"
	table.insert(data.categories, lang:getCanonicalName() .. "seisma-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local past_stem = ""
	local past_3sg_stem = ""
	
	if params.base == "kait" then
		past_stem = "kaitsesi"
		past_3sg_stem = "kaitses"
	else 
		past_stem = params.base .. params.strong .. "si"
		past_3sg_stem = params.base .. params.strong .. "sis"
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong .. "s"}
	stems["da_inf"]         = {params.base .. params.strong .. "st"}
	stems["pres"]           = {params.base .. params.weak .. "s" .. params.final}
	stems["past"]           = {past_stem}
	stems["past_3sg"]       = {past_3sg_stem}
	stems["impr"]           = {params.base .. params.strong .. "sk"}
	stems["pres_part"]      = {params.base .. params.strong .. "se"}
	stems["past_part"]      = {params.base .. params.strong .. "sn"}
	stems["pres_pasv"]      = {params.base .. params.strong .. "st"}
	stems["past_pasv_part"] = {params.base .. params.strong .. "st"}
	
	process_stems(data, stems)
end

inflections["naerma"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|33/naerma]]"
	table.insert(data.categories, lang:getCanonicalName() .. "naerma-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong}
	stems["da_inf"]         = {params.base .. params.strong .. "d"}
	stems["pres"]           = {params.base .. params.weak .. params.final}
	stems["past"]           = {params.base .. params.strong .. "si"}
	stems["past_3sg"]       = {params.base .. params.strong .. "is"}
	stems["impr"]           = {params.base .. params.strong .. "g"}
	stems["pres_part"]      = {params.base .. params.strong .. "e"}
	stems["past_part"]      = {params.base .. params.strong .. "n"}
	stems["pres_pasv"]      = {params.base .. params.strong .. "d"}
	stems["past_pasv_part"] = {params.base .. params.strong .. "d"}
	
	process_stems(data, stems)
end

inflections["saatma"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|34/saatma]]"
	table.insert(data.categories, lang:getCanonicalName() .. "saatma-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local weak_stem = params.base .. params.weak .. params.final
	local pasv_stem = params.base .. params.weak .. "e"
	
	if params.weak == "" then
		if mw.ustring.find(params.base, "ea$") and params.final == "a" then
			-- teadma
			weak_stem = params.base
			pasv_stem = params.base
		end
	end
	
	-- andma, kündma, etc w/ different 被動s
	if params.weak == "nn" then
		pasv_stem = params.base .. "n"
	end
	
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong}
	stems["da_inf"]         = {params.base .. params.strong}
	stems["pres"]           = {weak_stem}
	stems["past"]           = {params.base .. params.strong .. "si"}
	stems["past_3sg"]       = {params.base .. params.strong .. "is"}
	stems["impr"]           = {params.base .. params.strong .. "k"}
	stems["pres_part"]      = {params.base .. params.strong .. "e"}
	stems["past_part"]      = {params.base .. params.strong .. "n"}
	stems["pres_pasv"]      = {pasv_stem .. "t"}
	stems["past_pasv_part"] = {pasv_stem .. "t"}
	
	process_stems(data, stems)
end

inflections["leidma"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|34/saatma]]"
	table.insert(data.categories, lang:getCanonicalName() .. "saatma-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local weak_stem = params.base .. params.weak .. params.final
	local pasv_stem = params.base

	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong}
	stems["da_inf"]         = {params.base .. params.strong}
	stems["pres"]           = {weak_stem}
	stems["past"]           = {params.base .. params.strong .. "si"}
	stems["past_3sg"]       = {params.base .. params.strong .. "is"}
	stems["impr"]           = {params.base .. params.strong .. "k"}
	stems["pres_part"]      = {params.base .. params.strong .. "e"}
	stems["past_part"]      = {params.base .. params.strong .. "n"}
	stems["pres_pasv"]      = {pasv_stem .. "t"}
	stems["past_pasv_part"] = {pasv_stem .. "t"}
	
	process_stems(data, stems)
end


inflections["petma"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|35/petma]]"
	table.insert(data.categories, lang:getCanonicalName() .. "petma-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local cons = mw.ustring.sub(params.base .. params.strong, -1)
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.strong}
	stems["da_inf"]         = {params.base .. params.strong .. cons}
	stems["pres"]           = {params.base .. params.weak .. params.final}
	stems["past"]           = {params.base .. params.strong .. "si"}
	stems["past_3sg"]       = {params.base .. params.strong .. cons .. "is"}
	stems["impr"]           = {params.base .. params.strong .. "k"}
	stems["pres_part"]      = {params.base .. params.strong .. cons .. "e"}
	stems["past_part"]      = {params.base .. params.strong .. "n"}
	stems["pres_pasv"]      = {params.base .. params.weak .. "et"}
	stems["past_pasv_part"] = {params.base .. params.weak .. "et"}
	
	process_stems(data, stems)
end

inflections["tulema"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|36/tulema]]"
	table.insert(data.categories, lang:getCanonicalName() .. "tulema-類動詞")
	
	local params = get_params(args, 4)
	
	if params.strong == params.weak then
		data.title = data.title .. ",無層級變化"
	else
		data.title = data.title .. ",''" .. params.strong .. "-" .. (params.weak == "" and "ø" or params.weak) .. "''類變化"
	end
	
	local cons_strong = mw.ustring.sub(params.base .. params.strong, -1)
	local cons_weak = mw.ustring.sub(params.base .. params.weak, -1)
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. params.weak .. params.final}
	stems["da_inf"]         = {params.base .. params.strong .. (cons_strong == "s" and "t" or cons_strong)}
	stems["pres"]           = {params.base .. params.weak .. params.final}
	stems["past"]           = {params.base .. params.weak .. "i"}
	stems["past_3sg"]       = {params.base .. params.weak .. "i"}
	stems["impr"]           = {params.base .. params.weak .. (cons_weak == "s" and "k" or "g")}
	stems["pres_part"]      = {params.base .. params.weak .. "e"}
	stems["past_part"]      = {params.base .. params.weak .. "n"}
	stems["pres_pasv"]      = {params.base .. params.weak .. (cons_weak == "s" and "t" or cons_weak)}
	stems["past_pasv_part"] = {params.base .. params.strong .. (cons_strong == "s" and "t" or "d")}
	
	process_stems(data, stems)
end

inflections["olema"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|36/tulema]],不規則,無層級變化"
	table.insert(data.categories, lang:getCanonicalName() .. "tulema-類動詞")
	table.insert(data.categories, lang:getCanonicalName() .. "不規則動詞")
	
	local stems = {}
	stems["ma_inf"]         = {"ole"}
	stems["da_inf"]         = {"oll"}
	stems["pres"]           = {"ole"}
	stems["past"]           = {"oli"}
	stems["past_3sg"]       = {"oli"}
	stems["impr"]           = {"olg"}
	stems["pres_part"]      = {"ole"}
	stems["past_part"]      = {"oln"}
	stems["pres_pasv"]      = {"oll"}
	stems["past_pasv_part"] = {"old"}
	
	process_stems(data, stems)
	
	data.forms["pres_3sg"] = {"on"}
	data.forms["pres_3pl"] = {"on"}
end

inflections["minema"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|36/tulema]] 及 [[Appendix:愛沙尼亞語變位|34/saatma]],異幹,''k-ø'' 類變化"
	table.insert(data.categories, lang:getCanonicalName() .. "tulema-類動詞")
	table.insert(data.categories, lang:getCanonicalName() .. "saatma-類動詞")
	table.insert(data.categories, lang:getCanonicalName() .. "異幹動詞")
	
	local stems = {}
	stems["ma_inf"]         = {"mine"}
	stems["da_inf"]         = {"minn"}
	stems["pres"]           = {"lähe"}
	stems["past"]           = {"läksi"}
	stems["past_3sg"]       = {"läks"}
	stems["impr"]           = {"ming"}
	stems["pres_part"]      = {"mine"}
	stems["past_part"]      = {"läin"}
	stems["pres_pasv"]      = {"minn"}
	stems["past_pasv_part"] = {"mind"}
	
	process_stems(data, stems)
	
	data.forms["impr_2sg"] = {"mine"}
end


inflections["võima"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|37/võima]],無層級變化"
	table.insert(data.categories, lang:getCanonicalName() .. "võima-類動詞")
	
	local params = get_params(args, 1)
	local i = args["i"]; if i == "" then i = nil end
	
	local i_stem = mw.ustring.gsub(params.base, "([aeiouäöüõ])%1$", "%1i")
	
	local stems = {}
	stems["ma_inf"]         = {params.base}
	stems["da_inf"]         = {params.base .. "d"}
	stems["pres"]           = {params.base}
	stems["past"]           = {(i and i_stem or params.base .. "si")}
	stems["past_3sg"]       = {(i and i_stem or params.base .. "s")}
	stems["impr"]           = {params.base .. "g"}
	stems["pres_part"]      = {params.base}
	stems["past_part"]      = {params.base .. "n"}
	stems["pres_pasv"]      = {params.base .. "d"}
	stems["past_pasv_part"] = {params.base .. "d"}
	
	process_stems(data, stems)
end

inflections["käima"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|38/käima]],無層級變化"
	table.insert(data.categories, lang:getCanonicalName() .. "käima-類動詞")
	
	local params = get_params(args, 1)
	
	local vowels
	params.base, vowels = mw.ustring.match(params.base, "^(.-)([aeiouäöüõ]*)$")
	local raised_vowels = vowels
	local past_vowels = mw.ustring.gsub(vowels, "([aeiouäöüõ])%1$", "%1i")
	
	if raised_vowels == "oo" then
		-- jooma
		raised_vowels = "uu"
	elseif raised_vowels == "öö" then
		-- sööma
		raised_vowels = "üü"
	end
	
	if past_vowels == "oi" or past_vowels == "öi" then
		-- jooma, sööma
		past_vowels = "õi"
	end
	
	local stems = {}
	stems["ma_inf"]         = {params.base .. vowels}
	stems["da_inf"]         = {params.base .. raised_vowels}
	stems["pres"]           = {params.base .. vowels}
	stems["past"]           = {params.base .. (vowels == past_vowels and vowels .. "si" or past_vowels)}
	stems["past_3sg"]       = {params.base .. past_vowels .. (vowels == past_vowels and "s" or "")}
	stems["impr"]           = {params.base .. vowels .. "g"}
	stems["pres_part"]      = {params.base .. vowels}
	stems["past_part"]      = {params.base .. vowels .. "n"}
	stems["pres_pasv"]      = {params.base .. raised_vowels}
	stems["past_pasv_part"] = {params.base .. vowels .. "d"}
	
	process_stems(data, stems)
end

inflections["laskma"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|34/saatma]], irregular gradation"
	table.insert(data.categories, lang:getCanonicalName() .. "saatma-類動詞")
	
	local stems = {}
	stems["ma_inf"]         = {"lask"}
	stems["da_inf"]         = {"last"}
	stems["pres"]           = {"lase"}
	stems["past"]           = {"lasi", "lasksi"}
	stems["past_3sg"]       = {"lasi", "laskis"}
	stems["impr"]           = {"lask"}
	stems["pres_part"]      = {"lase"}
	stems["past_part"]      = {"laskn"}
	stems["pres_pasv"]      = {"last"}
	stems["past_pasv_part"] = {"last"}
	
	process_stems(data, stems)
	
	data.forms["impr_2sg"] = {"lase"}
end

inflections["pidama"] = function(args, data)
	data.title = "ÕS 分類 [[Appendix:愛沙尼亞語變位|34/õppima]], defective, d-ø gradation"
	table.insert(data.categories, lang:getCanonicalName() .. "õppima-類動詞")
	
	local stems = {}
	stems["ma_inf"]         = {"pida"}
	stems["da_inf"]         = {"pidad"}
	stems["pres"]           = {"pea"}
	stems["past"]           = {"pidi"}
	stems["past_3sg"]       = {"pidi"}
	stems["pres_part"]      = {"pida"}
	stems["past_part"]      = {"pidan"}

	process_stems(data, stems)
	
	data.forms["impr_2sg"] = {"—"}
	
end


function postprocess(args, data)
	local function addbefore(dest_key, source_key, prefix)
		if not data.forms[source_key] then
			return
		end
		
		data.forms[dest_key] = data.forms[dest_key] or {}
		
		for _, subform in ipairs(data.forms[source_key]) do
			if not subform:find("[[", nil, true) then
				table.insert(data.forms[dest_key], prefix .. "[[" .. subform .. "]]")
			else
				table.insert(data.forms[dest_key], prefix .. subform)
			end
		end
	end
	
	-- 現在 analytic forms
	addbefore("pres_neg", "pres_conn", "[[ei]] ")
	addbefore("pres_pasv_neg", "pres_pasv_conn", "[[ei]] ")
	
	addbefore("pres_perf_1sg", "past_part", "[[olen]] ")
	addbefore("pres_perf_2sg", "past_part", "[[oled]] ")
	addbefore("pres_perf_3sg", "past_part", "[[on]] ")
	addbefore("pres_perf_1pl", "past_part", "[[oleme]] ")
	addbefore("pres_perf_2pl", "past_part", "[[olete]] ")
	addbefore("pres_perf_3pl", "past_part", "[[on]] ")
	addbefore("pres_perf_pasv", "past_pasv_part", "[[on]] ")
	
	addbefore("pres_perf_neg", "past_part", "[[ei]] [[ole]] ")
	addbefore("pres_perf_neg", "past_part", "[[pole]] ")
	addbefore("pres_perf_pasv_neg", "past_pasv_part", "[[ei]] [[ole]] ")
	addbefore("pres_perf_pasv_neg", "past_pasv_part", "[[pole]] ")
	
	-- Past analytic forms
	addbefore("past_neg", "past_part", "[[ei]] ")
	addbefore("past_pasv_neg", "past_pasv_part", "[[ei]] ")
	
	addbefore("past_perf_1sg", "past_part", "[[olin]] ")
	addbefore("past_perf_2sg", "past_part", "[[olid]] ")
	addbefore("past_perf_3sg", "past_part", "[[oli]] ")
	addbefore("past_perf_1pl", "past_part", "[[olime]] ")
	addbefore("past_perf_2pl", "past_part", "[[olite]] ")
	addbefore("past_perf_3pl", "past_part", "[[oli]] ")
	addbefore("past_perf_pasv", "past_pasv_part", "[[oli]] ")
	
	addbefore("past_perf_neg", "past_part", "[[ei]] [[olnud]] ")
	addbefore("past_perf_neg", "past_part", "[[polnud]] ")
	addbefore("past_perf_pasv_neg", "past_pasv_part", "[[ei]] [[olnud]] ")
	addbefore("past_perf_pasv_neg", "past_pasv_part", "[[polnud]] ")
	
	-- 條件語態 analytic forms
	addbefore("cond_neg", "cond_conn", "[[ei]] ")
	addbefore("cond_pasv_neg", "cond_pasv_conn", "[[ei]] ")
	
	addbefore("cond_perf_1sg", "past_part", "[[oleksin]] ")
	addbefore("cond_perf_2sg", "past_part", "[[oleksid]] ")
	addbefore("cond_perf_3sg", "past_part", "[[oleks]] ")
	addbefore("cond_perf_1pl", "past_part", "[[oleksime]] ")
	addbefore("cond_perf_2pl", "past_part", "[[oleksite]] ")
	addbefore("cond_perf_3pl", "past_part", "[[oleksid]] ")
	addbefore("cond_perf_pasv", "past_pasv_part", "[[oleks]] ")
	
	addbefore("cond_perf_neg", "past_part", "[[ei]] [[oleks]] ")
	addbefore("cond_perf_neg", "past_part", "[[poleks]] ")
	addbefore("cond_perf_pasv_neg", "past_pasv_part", "[[ei]] [[oleks]] ")
	addbefore("cond_perf_pasv_neg", "past_pasv_part", "[[poleks]] ")
	
	-- 祈使語態 analytic forms
	if (data.forms["impr_2sg"] == "—") then
		data.forms["impr_perf_3sg"] = {"—"}
		data.forms["impr_perf_3pl"] = {"—"}
		data.forms["impr_perf_pasv"] = {"—"}
		data.forms["impr_2sg_neg"] = {"—"}
		data.forms["impr_3sg_neg"] = {"—"}
		data.forms["impr_perf_3sg_neg"] = {"—"}
		data.forms["impr_perf_3pl_neg"] = {"—"}
		data.forms["impr_perf_pasv_neg"] = {"—"}
	else
		addbefore("impr_perf_3sg", "past_part", "[[olgu]] ")
		addbefore("impr_perf_3pl", "past_part", "[[olgu]] ")
		addbefore("impr_perf_pasv", "past_pasv_part", "[[olgu]] ")
		addbefore("impr_2sg_neg", "impr_2sg", "[[ära]] ")
		addbefore("impr_3sg_neg", "impr_3sg", "[[ärgu]] ")
		addbefore("impr_perf_3sg_neg", "past_part", "[[ärgu]] [[olgu]] ")
		addbefore("impr_perf_3pl_neg", "past_part", "[[ärgu]] [[olgu]] ")
		addbefore("impr_perf_pasv_neg", "past_pasv_part", "[[ärgu]] [[olgu]] ")
	end
	addbefore("impr_1pl_neg", "impr_1pl", "[[ärgem]] ")
	addbefore("impr_2pl_neg", "impr_2pl", "[[ärge]] ")
	addbefore("impr_3pl_neg", "impr_3pl", "[[ärgu]] ")
	addbefore("impr_pasv_neg", "impr_pasv", "[[ärgu]] ")
	
	
	
	
	
	-- 引述語態 analytic forms
	addbefore("quot_neg", "quot", "[[ei]] ")
	addbefore("quot_pasv_neg", "quot_pasv", "[[ei]] ")
	
	addbefore("quot_perf", "past_part", "[[olevat]] ")
	addbefore("quot_perf_pasv", "past_pasv_part", "[[olevat]] ")
	
	addbefore("quot_perf_neg", "past_part", "[[ei]] [[olevat]] ")
	addbefore("quot_perf_neg", "past_part", "[[polevat]] ")
	addbefore("quot_perf_pasv_neg", "past_pasv_part", "[[ei]] [[olevat]] ")
	addbefore("quot_perf_pasv_neg", "past_pasv_part", "[[polevat]] ")
	
	-- Check if the lemma form matches the page name
	if data.forms["ma_inf"] and lang:makeEntryName(data.forms["ma_inf"][1]) ~= mw.title.getCurrentTitle().text then
		table.insert(data.categories, lang:getCanonicalName() .. "entries with inflection not matching pagename")
	end
end


-- Make the table
function make_table(data)
	local function show_form(form)
		if not form then
			return "—"
		elseif type(form) ~= "table" then
			error("a non-table value was given in the list of inflected forms.")
		end
		
		local ret = {}
		
		for key, subform in ipairs(form) do
			if mw.ustring.find(subform, "[`']") then
				-- TODO: Should use the standard language-agnostic features for character replacements here
				table.insert(ret, m_links.full_link({lang = lang, term = mw.ustring.gsub(subform, "[`']", ""), alt = subform}))
			else
				table.insert(ret, m_links.full_link({lang = lang, term = subform}))
			end
		end
		
		return table.concat(ret, "<br/>")
	end
	
	local function repl(param)
		if param == "lemma" then
			return m_links.full_link({lang = lang, alt = mw.title.getCurrentTitle().text}, "term")
		elseif param == "info" then
			return data.title and " (" .. data.title .. ")" or ""
		else
			return show_form(data.forms[param])
		end
	end
	
	local wikicode = [=[<div class="NavFrame">
<div class="NavHead" style="background:rgb(80%,80%,100%)">{{{lemma}}} 的屈折 {{{info}}}</div>
<div class="NavContent">
{| class="inflection-table" style="width:100%; border: solid 1px rgb(80%,80%,100%); margin-bottom: 0.5em; text-align: left;" cellspacing="1" cellpadding="2" 
|-
! colspan="6" style="background:rgb(80%,80%,100%)" | 直陳語氣
|-
! colspan="3" style="background:rgb(80%,80%,100%)" | 現在
! colspan="3" style="background:rgb(80%,80%,100%)" | 完成
|- style="background:rgb(90%,90%,100%)"
! style="background:rgb(80%,80%,100%); width: 7%" | 人稱
! style="width: 18%" | 肯定
! style="width: 21%" | 否定
! style="background:rgb(80%,80%,100%); width: 7%" | 人稱
! style="width: 21%" | 肯定
! style="width: 24%" | 否定
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{pres_1sg}}}
| rowspan="6" | {{{pres_neg}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{pres_perf_1sg}}}
| rowspan="6" | {{{pres_perf_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{pres_2sg}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{pres_perf_2sg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{pres_3sg}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{pres_perf_3sg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{pres_1pl}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{pres_perf_1pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{pres_2pl}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{pres_perf_2pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{pres_3pl}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{pres_perf_3pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 被動
| {{{pres_pasv}}}
| {{{pres_pasv_neg}}}
! style="background:rgb(80%,80%,100%)" | 被動
| {{{pres_perf_pasv}}}
| {{{pres_perf_pasv_neg}}}
|-
! colspan="3" style="background:rgb(80%,80%,100%)" | 過去
! colspan="3" style="background:rgb(80%,80%,100%)" | 過去完成
|- style="background:rgb(90%,90%,100%)"
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{past_1sg}}}
| rowspan="6" | {{{past_neg}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{past_perf_1sg}}}
| rowspan="6" | {{{past_perf_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{past_2sg}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{past_perf_2sg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{past_3sg}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{past_perf_3sg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{past_1pl}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{past_perf_1pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{past_2pl}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{past_perf_2pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{past_3pl}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{past_perf_3pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 被動
| {{{past_pasv}}}
| {{{past_pasv_neg}}}
! style="background:rgb(80%,80%,100%)" | 被動
| {{{past_perf_pasv}}}
| {{{past_perf_pasv_neg}}}
|-
! colspan="6" style="background:rgb(80%,80%,100%)" | 條件語態
|-
! colspan="3" style="background:rgb(80%,80%,100%)" | 現在
! colspan="3" style="background:rgb(80%,80%,100%)" | 完成
|- style="background:rgb(90%,90%,100%)"
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{cond_1sg}}}
| rowspan="6" | {{{cond_neg}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{cond_perf_1sg}}}
| rowspan="6" | {{{cond_perf_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{cond_2sg}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{cond_perf_2sg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{cond_3sg}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{cond_perf_3sg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{cond_1pl}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{cond_perf_1pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{cond_2pl}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{cond_perf_2pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{cond_3pl}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{cond_perf_3pl}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 被動
| {{{cond_pasv}}}
| {{{cond_pasv_neg}}}
! style="background:rgb(80%,80%,100%)" | 被動
| {{{cond_perf_pasv}}}
| {{{cond_perf_pasv_neg}}}
|-
! colspan="6" style="background:rgb(80%,80%,100%)" | 祈使語態
|-
! colspan="3" style="background:rgb(80%,80%,100%)" | 現在
! colspan="3" style="background:rgb(80%,80%,100%)" | 完成
|- style="background:rgb(90%,90%,100%)"
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{impr_1sg}}}
| {{{impr_1sg_neg}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱單數
| {{{impr_perf_1sg}}}
| {{{impr_perf_1sg_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{impr_2sg}}}
| {{{impr_2sg_neg}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱單數
| {{{impr_perf_2sg}}}
| {{{impr_perf_2sg_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{impr_3sg}}}
| {{{impr_3sg_neg}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱單數
| {{{impr_perf_3sg}}}
| {{{impr_perf_3sg_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{impr_1pl}}}
| {{{impr_1pl_neg}}}
! style="background:rgb(80%,80%,100%)" | 第一人稱複數
| {{{impr_perf_1pl}}}
| {{{impr_perf_1pl_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{impr_2pl}}}
| {{{impr_2pl_neg}}}
! style="background:rgb(80%,80%,100%)" | 第二人稱複數
| {{{impr_perf_2pl}}}
| {{{impr_perf_2pl_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{impr_3pl}}}
| {{{impr_3pl_neg}}}
! style="background:rgb(80%,80%,100%)" | 第三人稱複數
| {{{impr_perf_3pl}}}
| {{{impr_perf_3pl_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 被動
| {{{impr_pasv}}}
| {{{impr_pasv_neg}}}
! style="background:rgb(80%,80%,100%)" | 被動
| {{{impr_perf_pasv}}}
| {{{impr_perf_pasv_neg}}}
|-
! colspan="6" style="background:rgb(80%,80%,100%)" | 引述語態
|-
! colspan="3" style="background:rgb(80%,80%,100%)" | 現在
! colspan="3" style="background:rgb(80%,80%,100%)" | 完成
|- style="background:rgb(90%,90%,100%)"
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
! style="background:rgb(80%,80%,100%)" | 人稱
! 肯定
! 否定
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 主動
| {{{quot}}}
| {{{quot_neg}}}
! style="background:rgb(80%,80%,100%)" | 主動
| {{{quot_perf}}}
| {{{quot_perf_neg}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 被動
| {{{quot_pasv}}}
| {{{quot_pasv_neg}}}
! style="background:rgb(80%,80%,100%)" | 被動
| {{{quot_perf_pasv}}}
| {{{quot_perf_pasv_neg}}}
|-
! style="background:rgb(80%,80%,100%)" colspan="10" | Nominal forms
|-
! style="background:rgb(80%,80%,100%)" | ma-infinitive
! style="background:rgb(90%,90%,100%)" | 主動
! style="background:rgb(90%,90%,100%)" | 被動
! style="background:rgb(80%,80%,100%)" | da-infinitive
! style="background:rgb(90%,90%,100%)" | 主動
! style="background:rgb(90%,90%,100%)" | 被動
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 主格
| {{{ma_inf}}}
| {{{ma_inf_pasv}}}
! style="background:rgb(80%,80%,100%)" | da-form
| {{{da_inf}}}
| {{{da_inf_pasv}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 內格
| {{{ma_inf_ine}}}
| {{{ma_inf_pasv_ine}}}
! style="background:rgb(80%,80%,100%)" | des-form
| {{{des_inf}}}
| {{{des_inf_pasv}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 出格
| {{{ma_inf_ela}}}
| {{{ma_inf_pasv_ela}}}
! style="background:rgb(80%,80%,100%)" | 分詞
! style="background:rgb(90%,90%,100%)" | 主動
! style="background:rgb(90%,90%,100%)" | 被動
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 轉移格
| {{{ma_inf_tra}}}
| {{{ma_inf_pasv_tra}}}
! style="background:rgb(80%,80%,100%)" | 現在
| {{{pres_part}}}
| {{{pres_pasv_part}}}
|- style="background:rgb(95%,95%,100%)"
! style="background:rgb(80%,80%,100%)" | 欠格
| {{{ma_inf_abe}}}
| {{{ma_inf_pasv_abe}}}
! style="background:rgb(80%,80%,100%)" | 過去
| {{{past_part}}}
| {{{past_pasv_part}}}
|}</div></div>]=]

	return mw.ustring.gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)
end

return export