Modul:sh-headword

Üdvözlöm, Ön a Modul:sh-headword szó jelentését keresi. A DICTIOUS-ban nem csak a Modul:sh-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:sh-headword szót egyes és többes számban mondani. Minden, amit a Modul:sh-headword szóról tudni kell, itt található. A Modul:sh-headword szó meghatározása segít abban, hogy pontosabban és helyesebben fogalmazz, amikor beszélsz vagy írsz. AModul:sh-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:sh-headword/doc lapon tudod dokumentálni

local export = {}

local lang = require("Module:languages").getByCode("sh")

function export.otherscript()
	local title = mw.title.getCurrentTitle()
	local sc = require("Module:scripts").findBestScript(title.subpageText, lang)
	
	local other_sc
	
	if sc:getCode() == "Latn" then
		other_sc = "Cyrl"
	elseif sc:getCode() == "Cyrl" then
		other_sc = "Latn"
	end

	head = title.subpageText	
	tr = require("Module:sh-translit").tr(require("Module:links").remove_links(head), "sh", sc:getCode())

	return tr
end


local function otherscript(inflections, args)
	local title = mw.title.getCurrentTitle()
	local sc = require("Module:scripts").findBestScript(title.subpageText, lang)
	
	local other_sc
	
	if sc:getCode() == "Latn" then
		other_sc = "Cyrl"
	elseif sc:getCode() == "Cyrl" then
		other_sc = "Latn"
	end
	
	other_sc = require("Module:scripts").getByCode(other_sc)
	local inflection = {label = other_sc:getCanonicalName() .. " írás"}
	
	for i, head in ipairs(args) do
		if head == "" then
			head = title.subpageText
		end
		
		local tr = args
		
		if not tr then
			tr = require("Module:sh-translit").tr(require("Module:links").remove_links(head), "sh", sc:getCode())
		end
		
		table.insert(inflection, {term = tr, sc = other_sc})
	end
	
	table.insert(inflections, inflection)
end



function export.basic(frame)
	local params = {
		 = {list = true, default = ""},
		 = {list = true, allow_holes = true},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {lang = lang, pos_category = frame.args, categories = {}, heads = args, genders = {}, inflections = {}}
	
	otherscript(data.inflections, args)
	
	return require("Module:headword").full_headword(data)
end


function export.adjective(frame)
	local params = {
		 = {},
		 = {},
		 = {list = true, default = ""},
		 = {list = true, allow_holes = true},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {lang = lang, pos_category = "melléknevek", categories = {}, heads = args, genders = {}, inflections = {}}
	
	if args then
		table.insert(data.inflections, {label = "határozott", args})
	end
	
	if args then
		table.insert(data.inflections, {label = "középfok", args})
	end
	
	otherscript(data.inflections, args)
	
	return require("Module:headword").full_headword(data)
end


local gender_cats = {
	 = "hímnemű",
	 = "nőnemű",
	 = "semlegesnemű",
	 = "hímnemű",
	 = "nőnemű",
	 = "semlegesnemű",
}


function export.noun(frame)
	local params = {
		 = {list = true, default = "?"},
		 = {list = true, default = ""},
		 = {list = true, allow_holes = true},
		 = {list = true},
		 = {list = true},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {lang = lang, pos_category = "főnevek", categories = {}, heads = args, genders = args, inflections = {}}
	
	for i, gender in ipairs(data.genders) do
		if gender_cats then
			table.insert(data.categories, lang:getCanonicalName() .. " " .. gender_cats .. " főnevek")
		else
			data.genders = "?"
		end
	end
	
	otherscript(data.inflections, args)
	
	-- Add feminine and masculine forms.
	for _, val in pairs { { "f", "nőnemű" }, { "m", "hímnemű" }} do
		local param_name, label = unpack(val)
		local forms = args
		if forms then
			forms.label = label
			table.insert(data.inflections, forms)
		end
	end
	
	return require("Module:headword").full_headword(data)
end


function export.propernoun(frame)
	local params = {
		 = {list = true, default = "?"},
		 = {list = true, default = ""},
		 = {list = true, allow_holes = true},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {lang = lang, pos_category = "tulajdonnevek", categories = {}, heads = args, genders = args, inflections = {}}
	
	for i, gender in ipairs(data.genders) do
		if gender_cats then
			table.insert(data.categories, lang:getCanonicalName() .. " " .. gender_cats .. " főnevek")
		else
			data.genders = "?"
		end
	end
	
	otherscript(data.inflections, args)
	
	return require("Module:headword").full_headword(data)
end


function export.verb(frame)
	local params = {
		 = {},
		 = {list = true, default = ""},
		 = {list = true, allow_holes = true},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {lang = lang, pos_category = "igék", categories = {}, heads = args, genders = {}, inflections = {}}
	
	if args == "impf" or args == "pf" then
		table.insert(data.genders, args)
	elseif args == "impf-pf" or args == "pf-impf" or args == "dual" or args == "ip" then
		table.insert(data.genders, "impf")
		table.insert(data.genders, "pf")
	else
		table.insert(data.genders, "?")
	end
	
	otherscript(data.inflections, args)
	
	return require("Module:headword").full_headword(data)
end


return export