Module:nn-adj-reg

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

function export.main(frame)
	local word = mw.title.getCurrentTitle().text
	local args = frame:getParent().args
	local class = frame.args  
	local length = word:len()
	
	local data = {lang = lang, pos_category = "adjectives", categories = {}, inflections = {}}
	
	local root = word
	local root2 = word
	
	if class == '1' then
		local root_n = mw.ustring.gsub(word, "kk$", "k")
		table.insert(data.inflections, { label = 'neuter', root_n .. 't' })
		table.insert(data.inflections, { label = 'definite singular and plural', root .. 'e' })
	elseif class == '2' then
		table.insert(data.inflections, { label = 'indefinite singular', word })
		table.insert(data.inflections, { label = 'definite singular and plural', root .. 'e' })
	elseif class == '3' then
		table.insert(data.inflections, { label = 'singular and plural', word })
	elseif class == '4' then
		root = word:sub(1, length-2)
		root2 = root .. 'n'

		table.insert(data.inflections, {label = 'neuter', root .. 'e',  root .. 'ent'})
		table.insert(data.inflections, {label = 'definite singular and plural', root .. 'ne'})
	elseif class == '4_2012' then
		root = word:sub(1, length-2)
		root2 = root .. 'n'

		table.insert(data.inflections, {label = 'feminine', word, root .. 'i'})
		table.insert(data.inflections, {label = 'neuter', root .. 'e',  root .. 'i',  root .. 'ent'})
		table.insert(data.inflections, {label = 'definite singular and plural', root .. 'ne'})
	elseif class == '5' then
		root = word:sub(1, length-2)
		
		if word:sub(-2) == 'en' then -- e.g. 'rettkomen'
			root2 = root .. 'n' -- for the superlatives
			table.insert(data.inflections, {label = 'neuter', root .. 'e'})
			local root_dsg_pl = mw.ustring.gsub(root, "(.)%1$", "%1") -- rettkoMne (of ])
			table.insert(data.inflections, {label = 'definite singular and plural', root_dsg_pl .. 'ne'})
		else
			root2 = word:sub(1, length-2) .. word:sub(-1)
			table.insert(data.inflections, {label = 'neuter', word .. 't'})
			table.insert(data.inflections, {label = 'definite singular and plural', root2 .. 'e'})
		end
	end
	
	if args == 'meir' or args == 'more' or class == '3' then
		meir = true
	end
	
	if args == 'non-comparable' or args == 'non-comp' then
		meir = false
		non_comp = true
	end
	
	if meir then
		table.insert(data.inflections, { label = 'comparative', '] ' .. word })
		table.insert(data.inflections, { label = 'superlative', '] ' .. word })
	elseif not non_comp then
		table.insert(data.inflections, { label = 'comparative', root2 .. 'are' })
		table.insert(data.inflections, { label = 'indefinite superlative', root2 .. 'ast' })
		table.insert(data.inflections, { label = 'definite superlative', root2 .. 'aste' })
	end

	return require('Module:headword').full_headword(data)
end
 
return export