Module:lo-headword

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

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local export = {}
local pos_functions = {}

local lang = require("Module:languages").getByCode("lo")
local script = require("Module:scripts").getByCode("Laoo")
local PAGENAME = mw.title.getCurrentTitle().text

function export.show(frame)

	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
	local tr = args
	
	local data = {
		lang = lang,
		pos_category = poscat,
		categories = {},
		heads = {head},
		translits = {tr},
		inflections = {}
	}
	
	if pos_functions then
		pos_functions(args, data)
	end

	local letter = true
	local specialLetter = mw.ustring.gmatch(PAGENAME, '.-().-')
	while true do
		letter = specialLetter()
		if (not letter) then break end
		if letter == "໊" or letter == "໋" then
			table.insert(data.categories, "Lao terms spelled with ◌" .. letter) -- add dotted circle for above/below marks
		else
			table.insert(data.categories, "Lao terms spelled with " .. letter)
		end
		if letter == "ໆ" and PAGENAME ~= "ໆ" then
			table.insert(data.categories, "Lao reduplications")
		end
	end
	if mw.ustring.match(PAGENAME, '.-(ຼ).-') then
		table.insert(data.categories, "Lao terms spelled with ◌ຼ not in ຫຼ")
	end

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

end

pos_functions = function(args, data)

	local classifiers = {label = "classifier"}

	if args then
		for _,par in ipairs(args) do
			if par == "*" then
				table.insert(classifiers, PAGENAME) -- shorthand
				table.insert(data.categories, "Lao classifiers")
				table.insert(data.categories, "Lao nouns classified by " .. PAGENAME)
			else
				table.insert(classifiers, par)
				table.insert(data.categories, "Lao nouns classified by " .. par)
			end
		end
		table.insert(data.inflections, classifiers)
	end

end

pos_functions = function(args, data)

	local par1 = args; if par1 == "" then par1 = nil end
	local par2 = args; if par2 == "" then par2 = nil end
	local abstract_forms = {label = "abstract noun", accel = {form = "abstract-noun"}}

	if par1 ~= "-" then
		if not par1 then
			table.insert(abstract_forms, "ການ" .. PAGENAME)
		else
			if par1 == "~" then
				table.insert(abstract_forms, "ການ" .. PAGENAME)
				table.insert(abstract_forms, "ຄວາມ" .. PAGENAME)
			else
				table.insert(abstract_forms, par1)
				table.insert(abstract_forms, par2)
			end
		end
		table.insert(data.inflections, abstract_forms)
	end

end

pos_functions = function(args, data)

	local par1 = args; if par1 == "" then par1 = nil end
	local par2 = args; if par2 == "" then par2 = nil end
	local abstract_forms = {label = "abstract noun", accel = {form = "abstract-noun"}}

	if par1 ~= "-" then
		if not par1 then
			table.insert(abstract_forms, "ຄວາມ" .. PAGENAME)
		else
			table.insert(abstract_forms, par1)
			table.insert(abstract_forms, par2)
		end
		table.insert(data.inflections, abstract_forms)
	end

end

-- same logic
pos_functions = pos_functions
-- same logic
pos_functions = pos_functions

return export