Module:rmq-headword

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

This module implements the following templates (more to be implemented in the future):


local export = {}
local lang = require("Module:languages").getByCode("rmq")

--nouns
function export.show_noun(frame)
	local args = frame:getParent().args
	local data = {lang = lang, pos_category = "nouns", categories = {}, sort_key = args.sort, heads = {args.head}, genders, inflections = {}}
	local tracking_categories = {}
	
	--define variables

	local stem = mw.title.getCurrentTitle().text
	if args.head then --in case a different headword is specified
		stem = args.head
	end
	
	local short_stem = stem:sub(1, -2)
	local ending = ""

	--add gender
	local g, genders = args.g or args
	if g == "m" then
		data.genders = { "m" }
	elseif g == "f" then
		data.genders = { "f" }
	elseif g == "both" then
		data.genders = { "m","f" }
	else
		data.genders = { "?" }
	end
	
	--find ending
	ending = stem:sub(-1)
	if	stem:sub(-2,-1) == "ay" then
		 stem = stem:sub(1, -3)
		 ending = "ay"
	elseif stem:sub(-2,-1) == "oy" then
		stem = stem:sub(1, -3)
		ending = "oy"
	elseif stem:sub(-2,-1) == "uy" then
		stem = stem:sub(1,-3)
		ending = "uy"
	elseif stem:sub(-2,-1) == "ó" then
		stem = stem:sub(1,-3)
		ending = "ó"
	elseif stem:sub(-2,-1) == "í" then
		ending = "í"
	elseif ending == "y" then
		stem = stem:sub(1,-2)
	end

	--generate plurals
	local pl = args.pl or args
	if pl then
		if pl == "-" then
			table.insert(data.categories, "Caló uncountable nouns")
			data.inflections = {{label = "uncountable"}}
		else
			data.inflections = {{label = "plural", pl}}
		end
	else 
		if ending == "ay" then
			data.inflections = {{label = "plural", stem .. "áes"}}
		elseif ending == "oy" then
			data.inflections = {{label = "plural", stem .. "ayes"}}
		elseif ending == "uy" then
			data.inflections = {{label = "plural", stem .. "úes"}}
		elseif ending == "y" then
			data.inflections = {{label = "plural", stem .. "ís"}}
		elseif ending == "ó" then
			data.inflections = {{label = "plural", stem .. "és" }}
		elseif ending == "í" then
			data.inflections = {{label = "plural", stem .. "as"}}
		elseif ('aeiouáé'):match(ending) then
			data.inflections = {{label = "plural", stem .. "s"}}
		else
			data.inflections = {{label = "plural", stem .. "es"}}
		end
	end

	return require("Module:headword").full_headword(data) ..
		require("Module:utilities").format_categories(tracking_categories, lang, args.sort)
end

return export