Jump to content

Module:aio-headword

From Wiktionary, the free dictionary


-- The following code is same as phk, kht. Just different at language code.

local export = {}
local pos_functions = {}

local gsub = mw.ustring.gsub
local u = mw.ustring.char

local lang = require("Module:languages").getByCode("aio")
local script = require("Module:scripts").getByCode("Mymr")
local PAGENAME = mw.loadData("Module:headword/data").pagename

function export.show(frame)

	local args = frame:getParent().args
	local poscat = frame.args[1] or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")

	local headword = args["head"] or PAGENAME
	if mw.ustring.find(headword, u(0xFE00), 1, true) then
		error("Please remove the variant selector character [VS1] from headword.")
	end
	local head = headword -- dotted form is already converted by [[Module:languages/data]]
	local tr = args["tr"]

	local data = {
		lang = lang,
		pos_category = poscat,
		categories = {},
		heads = {head},
		translits = {tr},
		inflections = {}
	}

	if pos_functions[poscat] then
		pos_functions[poscat](args, data)
	end

	return require("Module:headword").full_headword(data)

end

--pos_functions here

return export