Modul:frm-headword

Üdvözlöm, Ön a Modul:frm-headword szó jelentését keresi. A DICTIOUS-ban nem csak a Modul:frm-headword szó összes szótári jelentését megtalálod, hanem megismerheted az etimológiáját, a jellemzőit és azt is, hogyan kell a Modul:frm-headword szót egyes és többes számban mondani. Minden, amit a Modul:frm-headword szóról tudni kell, itt található. A Modul:frm-headword szó meghatározása segít abban, hogy pontosabban és helyesebben fogalmazz, amikor beszélsz vagy írsz. AModul:frm-headword és más szavak definíciójának ismerete gazdagítja a szókincsedet, és több és jobb nyelvi forráshoz juttat.

A modult a Modul:frm-headword/doc lapon tudod dokumentálni

local export = {}
local pos_functions = {}

local lang = require("Module:languages").getByCode("frm")
local m_headword = require("Module:headword")

-- Clone parent's args while also assigning nil to empty strings.
-- Taken from module ru-headword.
local function clone_args(frame)
	local args = {}
	for pname, param in pairs(frame:getParent().args) do
		if param == "" then args = nil
		else args = param
		end
	end
	return args
end

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	local args = clone_args(frame)
	local poscat = frame.args or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
	HEAD = args or mw.title.getCurrentTitle().subpageText

	local genders = {}
	local inflections = {}
	local categories = {"Middle French " .. poscat}

	if pos_functions then
		pos_functions(args, genders, inflections, categories, wv)
	end

	return m_headword.full_headword{
		lang = lang,
		heads = {HEAD},
		genders = genders,
		inflections = inflections,
		categories = categories,
		sort_key = sort
	}
end

-- Apply ts > s and és > ez changes.
local function mp_morph(string)
	string = mw.ustring.gsub(string, "ts$", "s")
	string = mw.ustring.gsub(string, "és$", "ez")
	return string
end

local function make_mp()
	local plurals = {}
	if mw.ustring.match(HEAD, "$") then
		table.insert(plurals, HEAD)
	elseif mw.ustring.match(HEAD, "eau$") ~= nil then
		table.insert(plurals, HEAD .. "x")
		table.insert(plurals, HEAD .. "lx") -- -eaulx is as common as -eaux
	elseif mw.ustring.match(HEAD, "al$") ~= nil then
		local al = mw.ustring.gsub(HEAD, "al$", "aux")
		table.insert(plurals, al) -- -aulx is less common then -alx
	else
		table.insert(plurals, mp_morph(HEAD .. "s"))
	end
	return plurals
end

pos_functions = function(args, genders, inflections, categories)
	local g = args or args
	local f = args or args
	local plurals = {}
		table.insert(plurals, args or args)
		table.insert(plurals, 2, args)
	local fp = args or args
	local mfp = args

	table.insert(genders, "m")

	if g == "m-f" or g == "mf" then
		table.insert(genders, "f")

		mfp = mp_morph(HEAD .. "s")

		table.insert(inflections, {label = "plural", accel = {form = "p"}, mfp})
	else
		if not fs then
			if mw.ustring.match(HEAD, "é$") ~= nil then
				fs = mw.ustring.gsub(HEAD, "é$", "ee")
			elseif mw.ustring.match(HEAD, "és$") ~= nil then
				fs = mw.ustring.gsub(HEAD, "és$", "esse")
			elseif mw.ustring.match(HEAD, "if$") ~= nil then
				fs = mw.ustring.gsub(HEAD, "if$", "ifve")
			elseif mw.ustring.match(HEAD, "eux") ~= nil then
				fs = mw.ustring.gsub(HEAD, "eux$", "euse")
			else
				fs = HEAD .. "e"
			end
		end

		if not plurals then plurals = make_mp() end

		if not fp then
			fp = fs .. "s"
		end

		table.insert(inflections, {label = "feminine singular", accel = {form = "f|s"}, fs})
		table.insert(inflections, {label = "masculine plural", accel = {form = "m|p"}, plurals})
		if plurals then table.insert(inflections, plurals) end
		table.insert(inflections, {label = "feminine plural", accel = {form = "f|p"}, fp})
	end
end

pos_functions = function(args, genders, inflections, categories)
	local g = args or args
	local plurals = {}
	if args ~= "-" then
		table.insert(plurals, args or args)
	else
		table.insert(plurals, args)
	end
	table.insert(plurals, args or nil)
	local fs = args
	local fp = args

	if not g then
		table.insert(genders, "?")
	else
		table.insert(genders, g)
		if args then table.insert(genders, args) end
	end

	if not plurals then plurals = make_mp() end

	local function uncoutable_label_gen(p)
		export = "]"
		if args then export = "usually " .. export end
		return export
	end

	if args == "-" then
		table.insert(inflections, {label = uncoutable_label_gen(plurals)})
		pl_inflection_number = 1
		if args then
			table.insert(inflections, {label = "plural", accel = {form = "p"}, args})
		end
	else
		table.insert(inflections, {label = "plural", accel = {form = "p"}, plurals})
		if plurals then table.insert(inflections, plurals) end
	end

	if fs then
		table.insert(inflections, {label = "feminine singular", accel = {form = "f|s"}, fs})
		fp = fp or (fs .. "s")
		table.insert(inflections, {label = "feminine plural", accel = {form = "f|p"}, fp})
	end
end

return export