Module:nb-adj-reg

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

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 = 'masculine and feminine', root})
		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
		mer = true
        root2 = word:sub(1, length-2)
		table.insert(data.inflections, { label = 'indefinite singular', word})        
		table.insert(data.inflections, { label = 'definite singular and plural', root .. 'e', root2 .. 'ede'})
	elseif class == '5' then
        root2 = word:sub(1, length-2) .. word:sub(-1)
		table.insert(data.inflections, {label = 'masculine and feminine', word})
		table.insert(data.inflections, {label = 'neuter', word .. 't'})
		root2 = mw.ustring.gsub(word:sub(1, length-2), "(.)%1$", "%1") .. word:sub(-1) -- rettkoMNe of ]
		table.insert(data.inflections, {label = 'definite singular and plural', root2 .. 'e'})
	elseif class == '6' then
		mer = true
        root2 = word:sub(1, length-2)
        if  word:sub(-2) == 'et' then
        	table.insert(data.inflections, {label = 'indefinite singular', word})
        elseif word:sub(-2) == 'en' then	
			table.insert(data.inflections, {label = 'masculine and feminine', word})
			table.insert(data.inflections, {label = 'neuter', root2 .. 'et'})
		end
		table.insert(data.inflections, {label = 'definite singular and plural', root2 .. 'ne'})
	end
	
	if args == 'mer' or args == 'more' or class == '3' then
		mer = true
	end
	
	if args == 'non-comparable' or args == 'non-comp' then
		mer = false
		non_comp = true
	end
	
	if mer 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 .. 'ere'})
		
		if class == '2' and word:sub(-2) == 'ig' then
			table.insert(data.inflections, { label = 'indefinite superlative', root2 .. 'st'})
			table.insert(data.inflections, { label = 'definite superlative', root2 .. 'ste'})
		else
			table.insert(data.inflections, { label = 'indefinite superlative', root2 .. 'est'})
			table.insert(data.inflections, { label = 'definite superlative', root2 .. 'este'})
		end
	end

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