Module:smi-pro-nouns

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

local export = {}


function export.even(frame)
	local params = {
		 = {required = true, default = "{{{1}}}"},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {forms = {}, info = "even", categories = {lang:getCanonicalName() .. " even nouns"}}
	
	local umlaut_j = args
	local umlaut_e = args
	local umlaut_je = args
	
	if mw.ustring.find(args, "$") then
		local vowel = mw.ustring.match(args, "+$")
		table.insert(data.categories, lang:getCanonicalName() .. " even " .. vowel .. "-stem nouns")
		umlaut_j = mw.ustring.gsub(args, "ē$", "i")
		umlaut_je = mw.ustring.gsub(umlaut_j, "ō$", "u")
		umlaut_e = mw.ustring.gsub(umlaut_e, "ē$", "ā")
		umlaut_e = mw.ustring.gsub(umlaut_e, "ō$", "u")
	else
		table.insert(data.categories, lang:getCanonicalName() .. " even consonant-stem nouns")
	end
	
	data.forms = {args}
	data.forms = {args .. "m"}
	data.forms = {args .. "tē"}
	data.forms = {args .. "n"}
	data.forms = {args .. "nē"}
	data.forms = {args .. "snē"}
	data.forms = {args .. "stē"}
	data.forms = {umlaut_e .. "sën"}
	data.forms = {umlaut_j .. "jnē", umlaut_je .. "jnë"}
	data.forms = {args .. "ptākëk"}
	
	data.forms = {args .. "k"}
	data.forms = {umlaut_j .. "jtē"}
	data.forms = {umlaut_j .. "j"}
	data.forms = {umlaut_j .. "jnē"}
	data.forms = {umlaut_j .. "jstē"}
	
	-- Apply gradation
	for key, forms in pairs(data.forms) do
		for i, form in ipairs(forms) do
			forms = require("Module:smi-pro-common").apply_gradation(form)
		end
	end
	
	return make_table(data) .. require("Module:utilities").format_categories(data.categories, lang)
end


function export.odd(frame)
	local params = {
		 = {required = true, default = "{{{1}}}"},
		}
	
	local args = require("Module:parameters").process(frame:getParent().args, params)
	
	local data = {forms = {}, info = "odd", categories = {lang:getCanonicalName() .. " odd nouns"}}
	
	local xstem = args
	local umlaut_j = args
	local umlaut_e = args
	
	if mw.ustring.find(args, "$") then
		local vowel = mw.ustring.match(args, "+$")
		table.insert(data.categories, lang:getCanonicalName() .. " odd " .. vowel .. "-stem nouns")
		umlaut_j = mw.ustring.gsub(args, "ē$", "i")
		umlaut_e = mw.ustring.gsub(umlaut_e, "ē$", "ā")
		umlaut_e = mw.ustring.gsub(umlaut_e, "ō$", "u")
	else
		table.insert(data.categories, lang:getCanonicalName() .. " odd consonant-stem nouns")
		umlaut_e = mw.ustring.gsub(umlaut_e, "ē()$", "ā%1")
		umlaut_e = mw.ustring.gsub(umlaut_e, "ō()$", "u%1")
		xstem = umlaut_e .. "ë"
	end
	
	data.forms = {args}
	data.forms = {xstem .. "m"}
	data.forms = {args .. "tē"}
	data.forms = {xstem .. "n"}
	data.forms = {args .. "nē"}
	data.forms = {xstem .. "snē"}
	data.forms = {xstem .. "stē"}
	data.forms = {umlaut_e .. "sën"}
	data.forms = {xstem .. "jnē", xstem .. "jnë"}
	data.forms = {xstem .. "ptākëk"}
	
	data.forms = {xstem .. "k"}
	data.forms = {xstem .. "jtē"}
	data.forms = {xstem .. "j"}
	data.forms = {xstem .. "jnē"}
	data.forms = {xstem .. "jstē"}
	
	-- Apply gradation
	for key, forms in pairs(data.forms) do
		for i, form in ipairs(forms) do
			forms = require("Module:smi-pro-common").apply_gradation(form)
		end
	end
	
	return make_table(data) .. require("Module: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 then
			return "—"
		end
		
		local ret = {}
		
		for key, subform in ipairs(form) do
			table.insert(ret, require("Module:links").full_link({lang = lang, alt = "*" .. subform}))
		end
		
		return table.concat(ret, "<br/>")
	end
	
	local wikicode = [=[
{| class="inflection-table vsSwitcher" data-toggle-category="inflection" style="border: solid 1px #CCCCFF; text-align: left;" cellspacing="1" cellpadding="2"
|- style="background: #E2F6E2; text-align: left;"
! class="vsToggleElement" colspan="3" | {{{info}}}
|- class="vsShow" style="background: #F2F2FF;"
! style="min-width: 8em; background: #E2F6E2;" | Nominative
| style="min-width: 12em;" | {{{nom_sg}}}
|- class="vsShow" style="background: #F2F2FF;"
! style="min-width: 8em; background: #E2F6E2;" | Genitive
| style="min-width: 12em;" | {{{gen_sg}}}
|- class="vsHide"
! style="min-width: 8em; background:#c0e4c0" |
! style="min-width: 12em; background:#c0e4c0" | Singular
! style="min-width: 12em; background:#c0e4c0" | Plural
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Nominative
| {{{nom_sg}}}
| {{{nom_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Accusative
| {{{acc_sg}}}
| rowspan="2" | {{{acc_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Partitive
| {{{par_sg}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Genitive
| {{{gen_sg}}}
| {{{gen_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Essive
| {{{ess_sg}}}
| rowspan="2" | {{{ine_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Inessive
| {{{ine_sg}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Elative
| {{{ela_sg}}}
| {{{ela_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Illative
| {{{ill_sg}}}
| {{{ill_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Comitative
| {{{com_sg}}}
| {{{com_pl}}}
|- class="vsHide" style="background: #F2F2FF;"
! style="background: #E2F6E2;" | Abessive
| {{{abe_sg}}}
| {{{abe_pl}}}
|}]=]
	
	return mw.ustring.gsub(wikicode, "{{{(+)}}}", repl)
end

return export