Module:User:Ungoliant MMDCCLXIV

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

This is a private module sandbox of Ungoliant MMDCCLXIV, for their own experimentation. Items in this module may be added and removed at Ungoliant MMDCCLXIV's discretion; do not rely on this module's stability.


local m_utilities = require("Module:utilities")
local m_links = require("Module:links")
local m_hw = require("Module:headword")
local lang = require("Module:languages").getByCode("egl")
local infl = require("Module:egl-adj/data")
local export = {}

function export.show(frame)
	local pos = frame.args[1]
	local args = frame:getParent().args
	local stem = args[1]
	local suffix = args[2]
	local head = args["head"] or ""
	
	if not infl[suffix] then
		return make_error_hw(head, pos)
	else
		return make_hw(head, stem, infl[suffix], pos)
	end
end

function make_error_hw(head, pos)
	return m_hw.full_headword(lang, nil, head, nil, {"m"}, {{label="please add inflection"}}, {"Emilian " .. pos, "Emilian entries needing inflection"} , nil)
end

function make_hw(head, stem, suffixes, pos)
	local forms = {{label="masculine plural", stem .. suffixes.mp}, {label="feminine", stem .. suffixes.f}, {label="feminine plural", stem .. suffixes.fp}}
	return m_hw.full_headword(lang, nil, head, nil, {"m"}, forms, {"Emilian " .. pos}, nil)
end

return export