Module:bnt-phu-adjectives

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

local lang = require("Module:languages").getByCode("bnt-phu")

local export = {}


function export.adjective(frame)
	local params = {
		 = {},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {forms = {}, info = "adjective concord", categories = {}}
	
	if args == "L" or args == "H" or args == "LH" or args == "HH" or args == "HHH" then
		data.info = data.info .. ", tone " .. args
		table.insert(data.categories, lang:getCanonicalName() .. " adjectives with tone " .. args)
	elseif args then
		error("The tone must be \"L\", \"H\", \"LH\", \"HH\" or \"HHH\".")
	else
		table.insert(data.categories, "Requests for tone in " .. lang:getCanonicalName() .. " adjective entries")
	end
	
	local base = mw.title.getCurrentTitle().subpageText

	data.forms = {"legimu" .. base}
	data.forms = {"lomu" .. base}
	data.forms = {"lesiba" .. base}
	data.forms = {"leliba" .. base}
	data.forms  = {"lamu" .. base}
	data.forms  = {"laba" .. base}
	data.forms  = {"lomu" .. base}
	data.forms  = {"lemi" .. base}
	data.forms  = {"leli" .. base}
	data.forms  = {"lama" .. base}
	data.forms  = {"lesi" .. base}
	data.forms  = {"leti" .. base}
	data.forms  = {"le" .. base}
	data.forms = {"leti" .. base}
	data.forms = {"lobu" .. base}
	data.forms = {"loku" .. base}
	data.forms = {"loku" .. base}
	
	data.forms = {"gimu" .. base}
	data.forms = {"umu" .. base}
	data.forms = {"siba" .. base}
	data.forms = {"liba" .. base}
	data.forms  = {"mhu" .. base}
	data.forms  = {"bha" .. base}
	data.forms  = {"mhu" .. base}
	data.forms  = {"mhi" .. base}
	data.forms  = {"lhi" .. base}
	data.forms  = {"mha" .. base}
	data.forms  = {"ssi" .. base}
	data.forms  = {"tti" .. base}
	data.forms  = {"yhi" .. base}
	data.forms = {"tti" .. base}
	data.forms = {"bhu" .. base}
	data.forms = {"kku" .. base}
	data.forms = {"kku" .. base}
	
	return make_table(data) .. m_utilities.format_categories(data.categories, lang)
end


function export.relative(frame)
	local params = {
		 = {},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {forms = {}, info = "relative concord", categories = {}}
	
	if args == "L" or args == "H" or args == "LH" or args == "HH" or args == "HHH" then
		data.info = data.info .. ", tone " .. args
		table.insert(data.categories, lang:getCanonicalName() .. " adjectives with tone " .. args)
	elseif args then
		error("The tone must be \"L\", \"H\", \"LH\", \"HH\" or \"HHH\".")
	else
		table.insert(data.categories, "Requests for tone in " .. lang:getCanonicalName() .. " relative entries")
	end
	
	local base = mw.title.getCurrentTitle().subpageText
	
	data.forms = {"legi" .. base}
	data.forms = {"lo" .. base}
	data.forms = {"lesi" .. base}
	data.forms = {"leli" .. base}
	data.forms  = {"lo" .. base}
	data.forms  = {"laba" .. base}
	data.forms  = {"lo" .. base}
	data.forms  = {"le" .. base}
	data.forms  = {"leli" .. base}
	data.forms  = {"la" .. base}
	data.forms  = {"lesi" .. base}
	data.forms  = {"leti" .. base}
	data.forms  = {"le" .. base}
	data.forms = {"leti" .. base}
	data.forms = {"lobu" .. base}
	data.forms = {"loku" .. base}
	data.forms = {"loku" .. base}
	
	data.forms = {"gi" .. base}
	data.forms = {"u" .. base}
	data.forms = {"si" .. base}
	data.forms = {"li" .. base}
	data.forms  = {"u" .. base}
	data.forms  = {"ba" .. base}
	data.forms  = {"u" .. base}
	data.forms  = {"i" .. base}
	data.forms  = {"li" .. base}
	data.forms  = {"a" .. base}
	data.forms  = {"si" .. base}
	data.forms  = {"ti" .. base}
	data.forms  = {"i" .. base}
	data.forms = {"ti" .. base}
	data.forms = {"bu" .. base}
	data.forms = {"ku" .. base}
	data.forms = {"ku" .. base}
	
	return make_table(data) .. m_utilities.format_categories(data.categories, lang)
end


-- Make the table
function make_table(data)
	local function repl(param)
		if param == "info" then
			return mw.getContentLanguage():ucfirst(data.info or "")
		end
		
		local form = data.forms
		
		if not form or #form == 0 then
			return "—"
		end
		
		local ret = {}
		
		for key, subform in ipairs(form) do
			table.insert(ret, m_links.full_link({lang = lang, term = subform}))
		end
		
		return table.concat(ret, ", ")
	end
	
	local names = {
		 = "modifier",
		 = "copulative",
		
		 = "1st singular",
		 = "2nd singular",
		 = "1st plural",
		 = "2nd plural",
		
		 = "class 1",
		 = "class 2",
		 = "class 3",
		 = "class 4",
		 = "class 5",
		 = "class 6",
		 = "class 7",
		 = "class 8",
		 = "class 9",
		 = "class 10",
		 = "class 14",
		 = "class 15",
		 = "class 17",
	}
	
	local classes = {"c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c14", "c15", "c17"}
	local columns = {"mod"}
	
	if not data.simple then
		table.insert(classes, 1, "1sg")
		table.insert(classes, 2, "2sg")
		table.insert(classes, 3, "1pl")
		table.insert(classes, 4, "2pl")
		
		table.insert(columns, "cop")
	end
	
	local wikicode = {}
	
	table.insert(wikicode, mw.getCurrentFrame():expandTemplate{ 
		title = 'inflection-table-top', 
		args = {
			title = '{{{info}}}',
			palette = 'cyan',
			tall = 'yes',
		}
	})
	
	table.insert(wikicode, "|-")
	table.insert(wikicode, "!")
	
	for _, col in ipairs(columns) do
		table.insert(wikicode, "! " .. names)
	end
	
	for _, class in ipairs(classes) do
		table.insert(wikicode, "|-")
		table.insert(wikicode, "! " .. names)
		
		for _, col in ipairs(columns) do
			table.insert(wikicode, "| {{{" .. col .. "_" .. class .. "}}}")
		end
	end
	
	table.insert(wikicode, mw.getCurrentFrame():expandTemplate{ title = 'inflection-table-bottom' })
	
	wikicode = table.concat(wikicode, "\n")
	
	return mw.ustring.gsub(wikicode, "{{{(+)}}}", repl)
end


return export