Jump to content

Module:ms-derivations/affix-summary

From Wiktionary, the free dictionary

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

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

local special_ids = {
	[11] = "(''noun-producing'')",
	[111] = "(''verb-producing'')",
	[411] = "(''adverb-producing'')",
}

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] .. "#Malay|" .. data[1] .. "]]'' <small>[" .. data[3] .. "] (" .. data[4] .. ")</small>")
	end
	return table.concat(result, "\n")
end

return export