Module:pa-headword

Hello, you have come here looking for the meaning of the word Module:pa-headword. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:pa-headword, but we will also tell you about its etymology, its characteristics and you will know how to say Module:pa-headword in singular and plural. Everything you need to know about the word Module:pa-headword you have here. The definition of the word Module:pa-headword will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:pa-headword, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local export = {}
local m_scripts = require("Module:scripts")
local m_hi_pa_headword = require("Module:hi-pa-headword")

local lang = require("Module:languages").getByCode("pa")
local langname = "Punjabi"

local function track(page)
	require("Module:debug").track("pa-headword/" .. page)
end

local function process_other_script(forms, script_code)
	local inflection = {}
	local script_object = m_scripts.getByCode(script_code)
	for _, form in ipairs(forms) do
		table.insert(inflection, {term = form, lang = lang, sc = script_object})
	end
	inflection.label = script_object:getCanonicalName() .. " spelling"
	return inflection
end

function export.show(frame)
	local poscat = frame.args or error("Part of speech has not been specified. Please pass parameter 1 to the module invocation.")
	
	local params = {
		 = {list = true},
		 = {list = true, allow_holes = true},
		 = {},
		 = { list = true },
		 = { list = true },
		 = {type = "boolean"},
	}

	local PAGENAME = mw.loadData("Module:headword/data").pagename

	if PAGENAME:find(" ") then
		track("space")
	end

	if m_hi_pa_headword.pos_functions then
		for key, val in pairs(m_hi_pa_headword.pos_functions.params) do
			params = val
		end
	end

	local parargs = frame:getParent().args
	local args = require("Module:parameters").process(parargs, params)

	local data = {
		lang = lang,
		langname = langname,
		pos_category = poscat,
		sccat = true,
		heads = args,
		translits = args,
		categories = {},
		genders = {},
		inflections = {},
		sort_key = args,
	}

	if #data.translits > 0 then
		track("manual-translit/" .. poscat)
	end

	local heads = data.heads
	local auto_linked_head = require("Module:headword utilities").add_links_to_multiword_term(
		PAGENAME, {split_hyphen_when_space = args.splithyphen})
	if #heads == 0 then
		data.heads = {auto_linked_head}
		data.no_redundant_head_cat = true
	else
		for _, head in ipairs(heads) do
			if head == auto_linked_head then
				track("redundant-head")
			end
		end
	end

	if m_hi_pa_headword.pos_functions then
		m_hi_pa_headword.pos_functions.func(args, data)
	end

	if #args > 0 then
		table.insert(data.inflections, process_other_script(args, "Guru"))
	end
	if #args > 0 then
		table.insert(data.inflections, process_other_script(args, "pa-Arab"))
	end

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

return export