模組:Ms-derivations/affix-summary

維基詞典,自由的多語言詞典
此模組需要說明文件。
請在說明文件頁加上適當的描述(如其目的、使用方法等)。

local export = {}
local m_ms_derived = require("Module:ms-derivations").affix_table

local special_ids = {
	[11] = "(構成名詞)",
	[111] = "(構成動詞)",
	[411] = "(構成副詞)",
}

function export.show(frame)
	local result, ids = {}, {}
	local affix_table = m_ms_derived()
	for id, properties in pairs(affix_table) do
		table.insert(ids, id)
	end
	table.sort(ids)
	for _, id in ipairs(ids) do
		table.insert(result, special_ids[id] or nil)
		data = affix_table[id]
		table.insert(result, "* " .. id .. ":''[[" .. data[2] .. "#馬來語|" .. data[1] .. "]]''<small>[" .. data[3] .. "](" .. data[4] .. ")</small>")
	end
	return table.concat(result, "\n")
end

return export