Module:stq-headword

Hello, you have come here looking for the meaning of the word Module:stq-headword. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:stq-headword, but we will also tell you about its etymology, its characteristics and you will know how to say Module:stq-headword in singular and plural. Everything you need to know about the word Module:stq-headword you have here. The definition of the word Module:stq-headword will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:stq-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.

--Mostly based on the nl-headword module, with some changes.

local export = {}
local pos_functions = {}

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

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.show(frame)
	PAGENAME = mw.title.getCurrentTitle().text
	
	--Part of speech.
	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},
	}
	
	if pos_functions then
		for key, val in pairs(pos_functions.params) do
			params = val
		end
	end
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {lang = lang, pos_category = poscat, categories = {}, heads = args, genders = {}, inflections = {}, tracking_categories = {}}
	
	if pos_functions then
		pos_functions.func(args, data)
	end
	
	return require("Module:headword").full_headword(data) ..
		require("Module:utilities").format_categories(data.tracking_categories, lang, nil)
end

-- Display information for a noun's gender
-- This is separate so that it can also be used for proper nouns
function noun_gender(args, data)
	for _, g in ipairs(args) do
		if g ~= "m" and g ~= "f" and g ~= "n" then
			g = nil
		end
		
		table.insert(data.genders, g)
	end
	
	if #data.genders == 0 then
		table.insert(data.genders, "?")
	end
end

-- Display proper noun
pos_functions = {
	params = {
		 = {list = "g"},
		},
	func = function(args, data)
		noun_gender(args, data)
	end
}

-- Display information for a noun
pos_functions = {
	params = {
		 = {list = "g"},
		 = {list = true},
		 = {list = "pl"},
		
		 = {list = true},
		 = {list = true},
		},
	func = function(args, data)
		noun_gender(args, data)
		
		local plurals = args
		
		local mascforms = args
		local femforms = args
		
		--Uncountable
		if plurals == "-" then
			table.insert(data.inflections, {label = "]"})
			table.insert(data.categories, "Saterland Frisian uncountable nouns")
		else
			-- Add the plural forms
			plurals.label = "plural"
			plurals.accel = {form = "p"}
			plurals.request = true
			table.insert(data.inflections, plurals)
		end
		
		-- Add the feminine forms
		if #femforms > 0 then
			femforms.label = "feminine"
			table.insert(data.inflections, femforms)
		end
		
		-- Add the masculine forms
		if #mascforms > 0 then
			mascforms.label = "masculine"
			table.insert(data.inflections, mascforms)
		end
	end
}

return export