Module:kxd-headword

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


local export = {}
local pos_functions = {}

local lang = require("Module:languages").getByCode("kxd")
local PAGENAME = mw.title.getCurrentTitle().text
local script = lang:findBestScript(PAGENAME) -- Latn or kxd-Arab

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

	local head = args; if head == "" then head = nil end
	if (mw.ustring.find(PAGENAME, "اء")) then
		head = mw.ustring.gsub(PAGENAME, "(ا)(ء)()", "%1<sup>%2</sup>%3") -- superscript hamza
	end
	
	local data = {lang = lang, sc = script, pos_category = poscat, categories = {}, heads = {head}, translits = {"-"}, inflections = {}}
	
	if (head and mw.ustring.find(head, "")) or (args and mw.ustring.find(args, "")) or (args and mw.ustring.find(args, "")) or (args and mw.ustring.find(args, "")) then
		table.insert(data.categories, "Brunei Malay terms with incorrect Jawi spelling")
		error("Please use ک in place of ك and ݢ in place of ڬ.")
	end

	function export.affixation(text, affix)
		if affix == "-" then
			text = text .. "-" .. text
		elseif mw.ustring.match(affix, "^%-.+%-$") then
			first_consonant = mw.ustring.match(text, "^+")
			text = first_consonant .. mw.ustring.sub(affix, 2, -2) .. mw.ustring.sub(text, mw.ustring.len(first_consonant) + 1, -1)
		else
			text = gsub(affix, "%-", "#" .. text)
			text = gsub(text, "N(*)()(*)$", "nge%1%2%3")
			text = gsub(text, "meN#p", "memp")
			for pattern, replacement in pairs(pattern_replacements) do
				text = gsub(text, pattern, replacement)
			end
			text = gsub(text, "#?", letter_replacements)
			text = gsub(text, "#", "")
		end
		return text
	end

	local letter_replacements = {
		 = "m",  = "ng",  = "r"
	}

	local jawi = {label = "Jawi spelling"}
	local sc_Arab = require("Module:scripts").getByCode("kxd-Arab")
	if args then table.insert(jawi, { term = args, sc = sc_Arab }) end
	if args then table.insert(jawi, { term = args, sc = sc_Arab }) end
	if args then table.insert(jawi, { term = args, sc = sc_Arab }) end
	if #jawi > 0 then table.insert(data.inflections, jawi) end
	
	local rumi = {label = "Rumi spelling"}
	local sc_Latn = require("Module:scripts").getByCode("Latn")
	if args then table.insert(rumi, { term = args, sc = sc_Latn }) end
	if args then table.insert(rumi, { term = args, sc = sc_Latn }) end
	if args then table.insert(rumi, { term = args, sc = sc_Latn }) end
	if #rumi > 0 then table.insert(data.inflections, rumi) end
	
	if script:getCode() == "kxd-Arab" then
		table.insert(data.categories, "Brunei Malay terms with Jawi spelling")
	end
		
	if pos_functions then
		pos_functions(args, data)
	end

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

end

pos_functions = function(args, data)

	local pl = {label = "plural"}
	if args == "-" then
		table.insert(data.categories, "Brunei Malay uncountable nouns")
	else
		if args == nil then
			-- common plural
			local subwords = mw.text.split(PAGENAME, "%s")
			local firstword = subwords
			subwords = mw.ustring.gsub(firstword .. "-" .. firstword, "(+%-)%1%1", "%1") -- reduplicate only first word
			table.insert(pl, table.concat(subwords, " "))
			if script:getCode() == "kxd-Arab" then
				-- another form in Jawi
				subwords = firstword .. "۲" -- add "2" only first word
				table.insert(pl, table.concat(subwords, " "))
			end
		else
			table.insert(pl, args)
			if args then table.insert(pl, args) end
			if args then table.insert(pl, args) end
		end
		table.insert(data.inflections, pl)
	end

end

pos_functions = function(args, data)

	local pl = {label = "plural"}
	-- not necessary to have plural(s)
	if args then table.insert(pl, args) end
	if args then table.insert(pl, args) end
	if args then table.insert(pl, args) end
	if #pl > 0 then table.insert(data.inflections, pl) end

end

	local aliases = {
	='trp', ='trp',
	='tro', ='tro',
	='in', ='in', ='in',
	='fl', ='fl',
	}

pos_functions = function(args, data)
   local tr = args or ""
	tr = aliases or tr
	if tr ~= "" then
		if tr == "tr" then table.insert(data.inflections, {label = "transitive"})
		table.insert(data.categories, "Brunei Malay transitive verbs") end
		if tr == "in" then table.insert(data.inflections, {label = "intransitive"})
		table.insert(data.categories, "Brunei Malay intransitive verbs") end
	    if tr == "st" then table.insert(data.inflections, {label = "stative"})
	    table.insert(data.categories, "Brunei Malay stative verbs") end
	else
		table.insert(data.categories, "Brunei Malay verbs without transitivity")
	end
end

pos_functions = function(args, data)

	local aform = {label = "used in the form"}
	for _,a in ipairs(args) do
		table.insert(aform, a)
	end
	if #aform > 0 then table.insert(data.inflections, aform) end

end

pos_functions = function(args, data)
	
	local se = {label = "singular"}
	if args ~= "-" or args == nil then
		table.insert(data.inflections, se)
    if script:getCode() == "kxd-Arab" then
            table.insert(se, mw.ustring.format("]",
				PAGENAME))
		else
			table.insert(se, mw.ustring.format("]",
				PAGENAME))
		end
	end
end

return export