Module:User:Sarri.greek/grk-nouns-decl

-- 2024.03.06. [[wikt:en:User:Sarri.greek]]
--[=[
Inflectional table for noun declensions in Greek (various phases, [[polytonic]] or [[monotonic]])
PRINCIPLES
	Allow complete freedom for the editor.
	Make declension Templates, Categories of declensions, of exceptions too.
	Make modules easy to edit. SEE the full declension and its Categories at /function pages.
	Grammatical terms of titles in English
		and tooltips in English (the host language of en.wiktionary)
		plus translation to the target language.
STRUCTURE of module
	main page has rules and tables
	/param page has a wide collection of parameters.
		They follow every function of the /1 function page.
		No need to rewrite at declension Templates the parameters again and again.
	/1(, 2, 3...) pages for functions: set sequences of declensions to make Templates.
	Parameters with the suffix mod- are the parameters set in this module's functions.
		Without the suffix mod-, is the editor's overriding of each parameter.
		
STRUCTURE of cells (example for genitive singular SG)
aGS = the cell and the word.article for GS. Required from other modules.
GScell has two lines GSline and GS2line
	GSline has: GStxt1 .. GSterm .. GSflag .. GStxt
	The term has: common1 .. GSword .. common. The term can be transliterated as a whole.
	The word has link for: GSstem .. GSsuf (alternative output: GSstem+, GSsuf+)
A second singular column or/and a second plural column are possible (for nouns with double genders).
Sections of the table, titles, params can be altered according to the language code used
	For example, no dual for Medieval Greek, no datives for vulgar Medieval or Modern Greek, ...
CONTENTS
	1) stem production, required modules
	2) links & style
	3) the table
	4) categories
PROBLEMS
	many.
	term and word and transliteration are not done yet.
]=]--

export = {} -- DO NOT write local export. It does not work.

--------------------------------------------------------------------------
--                 1. STEM PRODUCTION, REQUIRED MODULES                 --
--------------------------------------------------------------------------

--languages = require("Module:languages") -- choose grk language: grc, grc-koi, gkm, el-kth, el, etc
	-- e.g. require("Module:languages").getByCode("grc")
	-- lang_iso is the official ISO code as in [[Module:languages]]
	-- lang choices like parameters grc=1, gkm=1, el-kth=1 are for special titles etc of each table.

module_path = 'Module:User:Sarri.greek/grk-nouns-decl'

m_1 = require(module_path .. "/1") 
-- cannot call all subpages directly from here. Each one will call the next:
-- here we call m_1 = require(module_path .. "/1")
		-- m_1 calls: m_2 = require(module_path .. "/2")
			-- m_2 calls m_3 and so forth

m_stems = require("Module:User:Sarri.greek/stems") -- cut parts of words to create stems

m_stems_grk = require("Module:User:Sarri.greek/grk-stems") -- stem production for grk
	-- conversions of diacritics on a  stem
m_data = require("Module:User:Sarri.greek/grk-stems/data") -- write sequences of letters
	-- e.g. m_data.brachy_oxia = '[έὲἔἒἕἓόὸὄὂὅὃΈῈἜἚἝἛΌῸὌὊὍὋ]'

-- articles: Write below, exactly at where they are needed:
		-- polytonic: require ('Module:grc-articles').articles (args)
		-- monotonic: require ('Module:el-articles').articles (args)

-- parameters: call the page /param (it has all parameters) at bottom of this page

--------------------------------------------------------------------------
--                          2. links & styles                           --
--------------------------------------------------------------------------
-- also, see below, at languages, special colours for different language ISO
-- possible: different colour for stems - endings

-- =============== colours
-- borders (sample 1)
c_border = '#c9d7e8'		-- same as c3 or stronger: same as c_1
c_bord = '#f4f4f4'			-- inner soft borders
c_bordR = '' 
	-- If there are more columns, it is soft c_bord.
	-- If it is an outer border, it is stronger c_border.

-- background colours (sample 1)
c_extra = '#b0c4de'	-- very dark. For extratitle.
c_1 = '#93aed2'		-- dark. For title1 MAIN, number names - border for title2 if it exists
c_2 = '#a5bcd9'		-- not so dark. For title2, subtitles, genders of adjectives - border for title1
c_3 = '#e3e5e8'		-- grey. For title3, all the subtitles.
c_4 = '#edf2f7'		-- very soft. For background for notes.

-- font colours (sample 1: all black)
c_ending = '#000000'		-- black. At el.wikt is DeepPink #eb0000
c_stem = '#000000'		-- black. Also try #002000
c_black = '#000000'		-- for subtitles
-- to do
-- expected: grey?
-- attested: bold?

-- =============== styles
-- for table style, cf. the beginning of fulltable

font_cell = "font-family:; letter-spacing:1px;"		-- tested, rejected: Palatino linotype; font-family:Times; 
fontsize_cell = "font-size:110%;"	-- 105%?

--  ============== apply font colours
-- for parts of a word
ending_color = function(suffix)
    return '<span style="color:' .. c_ending ..'; font-weight:normal;">' .. suffix .. '</span>'
end

stem_color = function(thema)
    return '<span style="color:' .. c_stem ..'; font-weight:normal;">' .. thema .. '</span>'
end

infix_color = function(infix)
    return '<span style="color:' .. c_stem ..'; font-weight:normal;">' .. infix .. '</span>'
end
	-- this is not exactly an inifix. It is extra letters of a 2nd stem.
	-- possible different colour or weight

-- for subtitles:
black_color = function(black_thing)
    return '<span style="color:' .. c_black ..'; font-weight:normal;">' .. black_thing .. '</span>'
end

-- ====================== Links for the words in the table
-- create_link = function(page, text) -- see at /param page


-- it controls stem (thema) and ending (suffix)
linkcontrol2 = function(thema, suffix)
	thema = thema or ''
	suffix = suffix or ''
	return create_link(thema .. suffix, stem_color(thema) ..  ending_color(suffix))
end

-- it controls stem, infixed letters and ending
linkcontrol3 = function(thema, infix, suffix)
	thema = thema or ''
	infix = infix or ''
	suffix = suffix or ''
	return create_link(thema .. infix .. suffix, stem_color(thema) ..  infix_color(infix) .. ending_color(suffix))
end

-- ====================== Errors -- use it with writing: if blahblah then return errorhere('xxxxxx') end
errorhere = function(errstring)
	return '<div class="error">' .. errstring .. '</div>[[Category:Track errors User Sarri.greek]]'
end


-- NOT USED HERE
-- only for grc (Ancient Greek) when dichrona letters α, ι, υ NEED prosody
error_dichr = function(errordichrstring)
	page = mw.title.getCurrentTitle()
	page.name = page.text:match( "^%s*(.-)%s*$" )
	if page.namespace == 0 then	-- Categories work only in MAIN namespace	
	return '<div style="font-size:15px; color:red;">* Declension needs prosody with |dichr=b (brachy) or  |dichr=m (macron).'
		..'<br>If there is no information, |dichr=? Probable, |dichr=uncertain (puts brachy)</div>'
		.. '[[Category:Terms with no prosody on dichrona (Ancient Greek)]]'	
	else
	return  '<div style="font-size:15px; color:red;">* Declension needs prosody with |dichr=b (brachy) or  |dichr=m (macron).'
		..'<br>If there is no information, |dichr=? Probable, |dichr=uncertain (puts brachy)</div>'
	end
end

--------------------------------------------------------------------------
--                            3. TABLE                                  --
--------------------------------------------------------------------------

fulltable = function(args)
	
	
-- table: DEFAULT at LEFT -- for some browsers need border="1"
local float = args['float'] or ''
	if args['float'] == 'right' then
table_style1 = 'style="clear:right; float:right; margin-left:0.5em; margin-bottom:0.5em;'
	.. 'background:#ffffff; border:1px solid' .. c_border ..'; text-align:right;"'
	.. 'rules="none" border="1" cellpadding="3" cellspacing="0"'
	elseif args['float'] == 'center' then
table_style1 = 'style="margin-left:auto; margin-right:auto; margin-bottom:0.5em;'
	.. 'background:#ffffff; border:1px solid' .. c_border ..'; text-align:center;"'
	.. 'rules="none" border="1" cellpadding="3" cellspacing="0"'	
	else
table_style1 = 'style="clear:left; float:left; position:relative; margin:0px 1.5em 0.5em 0px;'
	.. 'background:#ffffff; border:1px solid' .. c_border ..'; text-align:left;"'
	.. 'rules="none" border="1" cellpadding="3" cellspacing="0"'
	end

-- also see /param page
-- mod- = as in the module
	if args['lang_title'] ~= '' and args['lang_title'] ~=  nil then
		args['mod-title'] = args['lang_title'] .. '<br>' .. args['mod-title']
	end


-- =============== LANGUAGES for categories and notes 
-- see /param page


-- =============== OTHER PARAMs
	local columns = args['cols'] or ''
		-- number of columns: 1+2 if only one number, 1+4 if 2 numbers 1+6 if double plural or double singular, 1+8 double sing & double pl
	local dichr = args['dichr'] or ''		-- for dichronous (either macron or brachy δίχρ=β is brachy)

-- NOT USED
--[=[
	if args['place'] == '1' or args['name'] == '1' or args['patronymic'] == '1' or args['proper'] == '1' then
		cat_pos = 'Proper nouns'
]=]--

-- typos, declension -- 	cat = args['cat'] or ''	-- this does not work from here
	typos = args['type'] or ''		-- this is name of declension
	local declension = args['decl'] or ''		-- also see notes and Categories
		if args['decl'] == '1' then declension = '1st' end
		if args['decl'] == '2' then declension = '2nd' end
		if args['decl'] == '2att' then declension = '2nd attic' end
		if args['decl'] == '3' then declension = '3rd' end
		if args['decl'] == 'irregular' then declension = 'irregular' end 
		if args['decl'] == '0' then declension = 'irregular' end
		if args['decl'] == 'm' then declension = 'masculine' end
		if args['decl'] == 'f' then declension = 'feminine' end
		if args['decl'] == 'n' then declension = 'neuter' end
		if args['decl'] == 'c' then declension = 'common gender' end
		-- mf, fm, fn?


-- =============== lines and rows
	local stem_line = ''
	local stem_cell = ''
	-- stem line MUST be placed at Section ROWS

-- row for subtitles
	local subtitle = ''
	local subtitle_sg = args['subtitle-sg'] or ''
	-- TODONOW MUST add these:
			if args['subtitle-sg'] == 'm' then args['subtitle-sg'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-sg'] == 'f' then args['subtitle-sg'] = '[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-sg'] == 'n' then args['subtitle-sg'] = '[[neuter|' .. black_color('neuter') .. ']]'
		elseif args['subtitle-sg'] == 'c' then args['subtitle-sg'] = '<span title="common gender - κοινού γένους">common</span> [[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]]/[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-sg'] == 'mf' then args['subtitle-sg'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]] or [[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-sg'] == 'fm' then args['subtitle-sg'] = '[[feminine|' 
			.. black_color('feminine') .. ']] or [[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-sg'] == 'fn' then args['subtitle-sg'] = '[[feminine|' .. black_color('feminine') .. ']] or [[neuter|' .. black_color('neuter') .. ']]'
-- do I need to negate all the above here?
		else args['subtitle-sg'] = args['subtitle-sg'] or ''
		end
	local subtitle_sg2 = args['subtitle-sg2'] or ''
			if args['subtitle-sg2'] == 'm' then args['subtitle-sg2'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-sg2'] == 'f' then args['subtitle-sg2'] = '[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-sg2'] == 'n' then args['subtitle-sg2'] = '[[neuter|' .. black_color('neuter') .. ']]'
		elseif args['subtitle-sg2'] == 'c' then args['subtitle-sg2'] = '<span title="common gender - κοινού γένους">common</span> [[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]]/[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-sg2'] == 'mf' then args['subtitle-sg2'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]] or [[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-sg2'] == 'fm' then args['subtitle-sg2'] = '[[feminine|' 
			.. black_color('feminine') .. ']] or [[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-sg2'] == 'fn' then args['subtitle-sg2'] = '[[feminine|' .. black_color('feminine') .. ']] or [[neuter|' .. black_color('neuter') .. ']]'
		else args['subtitle-sg2'] = args['subtitle-sg2'] or ''
		end
	local subtitle_pl = args['subtitle_pl'] or ''
			if args['subtitle-pl'] == 'm' then args['subtitle-pl'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-pl'] == 'f' then args['subtitle-pl'] = '[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-pl'] == 'n' then args['subtitle-pl'] = '[[neuter|' .. black_color('neuter') .. ']]'
		elseif args['subtitle-pl'] == 'c' then args['subtitle-pl'] = '<span title="common gender - κοινού γένους">common</span> [[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]]/[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-pl'] == 'mf' then args['subtitle-pl'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]] or [[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-pl'] == 'fm' then args['subtitle-pl'] = '[[feminine|' 
			.. black_color('feminine') .. ']] or [[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-pl'] == 'fn' then args['subtitle-pl'] = '[[feminine|' .. black_color('feminine') .. ']] or [[neuter|' .. black_color('neuter') .. ']]'
		else args['subtitle-pl'] = args['subtitle-pl'] or ''
		end
	local subtitle_pl2 = args['υπότιτλος-pl2'] or ''
			if args['subtitle-pl2'] == 'm' then args['subtitle-pl2'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-pl2'] == 'f' then args['subtitle-pl2'] = '[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-pl2'] == 'n' then args['subtitle-pl2'] = '[[neuter|' .. black_color('neuter') .. ']]'
		elseif args['subtitle-pl2'] == 'c' then args['subtitle-pl2'] = '<span title="common gender - κοινού γένους">common</span> [[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]]/[[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-pl2'] == 'mf' then args['subtitle-pl2'] = '[[masculine|<span title="masculine gender - αρσενικό γένος">' 
			.. black_color('masculine') .. '</span>]] or [[feminine|' .. black_color('feminine') .. ']]'
		elseif args['subtitle-pl2'] == 'fm' then args['subtitle-pl2'] = '[[feminine|' 
			.. black_color('feminine') .. ']] or [[masculine|<span title="masculine gender - αρσενικό γένος">' .. black_color('masculine') .. '</span>]]'
		elseif args['subtitle-pl2'] == 'fn' then args['subtitle-pl2'] = '[[feminine|' .. black_color('feminine') .. ']] or [[neuter|' .. black_color('neuter') .. ']]'
		else args['subtitle-pl2'] = args['subtitle-pl2'] or ''
		end
--TODO subtitles for multiple variation of genders

-- =============== NEED all parameters of the fulltable
	-- numbers
	local sg_title_str = ''			-- singularis title string / ἑνικός
	local sg2_title_str = ''		-- 2nd singualr title / 2ος ενικός αν υπάρχει
	local pl_title_str = ''			-- pluralis  title / πληθυντικός
	local pl2_title_str = ''		-- 2nd plural title / 2ος πληθυντικός αν υπάρχει
	local dualrow = ''				-- not always
	local du_title_str = ''			-- dualis title / δυϊκός
	-- cases
	local nom_sg_str = ''			-- nominativus singularis / ὀνομαστική ἑνικός
	local nom_sg2_str = ''
	local nom_pl_str = ''
	local nom_pl2_str = ''
	local nom_du_str = ''
	local gen_sg_str = ''			-- genitivus / γενική
	local gen_sg2_str = ''
	local gen_pl_str = ''
	local gen_pl2_str = ''
	local gen_du_str = ''
	local dat_sg_str = ''			-- dativus / δοτική
	local dat_sg2_str = ''
	local dat_pl_str = ''
	local dat_pl2_str = ''
	local dat_du_str = ''
	local acc_sg_str = ''			-- accusativus / αἰτιατική
	local acc_sg2_str = ''
	local acc_pl_str = ''
	local acc_pl2_str = ''
	local acc_du_str = ''
	local voc_sg_str = ''			-- vocativus / κλητική
	local voc_sg2_str = ''
	local voc_pl_str = ''
	local voc_pl2_str = ''
	local voc_du_str = ''
	-- articles / ἄρθρα (see Module for grc or el  articles (Also parameter άρθρα=0 to omit all articles)
	local a_nom_sg_str = ''
	local a_nom_sg2_str = ''
	local a_nom_pl_str = ''
	local a_nom_pl2_str = ''
	local a_nom_du_str = ''
	local a_gen_sg_str = ''
	local a_gen_sg2_str = ''
	local a_gen_pl_str = ''
	local a_gen_pl2_str = ''
	local a_gen_du_str = ''
	local a_dat_sg_str = ''
	local a_dat_sg2_str = ''
	local a_dat_pl_str = ''
	local a_dat_pl2_str = ''
	local a_dat_du_str = ''
	local a_acc_sg_str = ''
	local a_acc_sg2_str = ''
	local a_acc_pl_str = ''
	local a_acc_pl2_str = ''
	local a_acc_du_str = ''
	local a_voc_sg_str = ''
	local a_voc_sg2_str = ''
	local a_voc_pl_str = ''
	local a_voc_pl2_str = ''
	local a_voc_du_str = ''


-- ARTICLES ===========================================================
-- monotonic, phonemic transliteration
	if args['el'] == '1' -- or also pnt, tsd, etc check all dialects
	then
	require ('Module:User:Sarri.greek/el-articles').articles (args)
	
--[=[
-- polytonic + datives, no dual, phonemic transliteration
	elseif args['gkm'] == '1' or args['gkm'] == '2'
		or args['grk-gkm'] == '1' or args['grk-gkm'] == '2'
		or args['el-kth'] == '1' or args['kath'] == '2'
	then
	require ('Module:User:Sarri.greek/gkm-articles').articles (args)
]=]--

-- need a default  -- full aritcles (duals and datives as in Ancient Greek)
-- polytonic + dual, exact symbol transliteration
	else
	require ('Module:User:Sarri.greek/grc-articles').articles (args)
	end

-- ============== grammatical terms (English) with tooltips according to language
-- put at the table, writing: .. singular ..
-- separately gkm (just in case there will be differences)
-- tooltips in English and Greek (polytonic also has accent bareia)
-- Declare with xxxx = args['xvz'] or '' is needed otherwise NOTHING works
-- Then, make the arg zero, otherwise we see an empty cell
singular = args['singular'] or ''	args['singular'] = args['singular'] or ''
if args['singular'] then
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		singular = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[singular|<span title="singular number - ἑνικὸς ἀριθμός" style="color:black;"><b><i>singular</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		singular = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[singular|<span title="singular number - ἑνικὸς ἀριθμός" style="color:black;"><b><i>singular</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	elseif args['el'] == '1' then
		singular = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[singular|<span title="singular number - ενικός αριθμός" style="color:black;"><b><i>singular</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	else
		singular = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[singular|<span title="singular number" style="color:black;"><b><i>singular</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	end
end
plural = args['plural'] or ''	args['plural'] = args['plural'] or ''
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		plural = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number - πληθυντικὸς ἀριθμός" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		plural = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number - πληθυντικὸς ἀριθμός" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	elseif args['el'] == '1' then
		plural = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number - πληθυντικός αριθμός" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	else
		plural = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
	end
dual  = args['dual'] or ''	args['dual'] = args['dual'] or '' -- to omit dual, args['du'] = '-'
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		dual = '[[dual|<span title="dual mumber - δυϊκὸς ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		dual = '[[dual|<span title="dual mumber - δυϊκὸς ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]'
			-- normally, not needed at gkm
	elseif args['el'] == '1' then
		dual = '[[dual|<span title="dual number - δυϊκός αριθμός" style="color:black;"><b><i>dual</i></b></span>]]'
			-- normally, not needed at el
	else
		dual = '[[dual|<span title="dual number" style="color:black;"><b><i>dual</i></b></span>]]'
	end

nominative = args['nominative'] or ''	args['nominative'] = args['nominative'] or ''
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		nominative = '[[nominative|<span title="nominative case - ὀνομαστικὴ πτῶσις" style="color:black;"><b><i>nominative</i></b></span>]]'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		nominative = '[[nominative|<span title="nominative case - ὀνομαστικὴ πτῶσις" style="color:black;"><b><i>nominative</i></b></span>]]'
	elseif args['el'] == '1' then
		nominative = '[[nominative|<span title="nominative case - ονομαστική πτώση" style="color:black;"><b><i>nominative</i></b></span>]]'
	else
		nominative = '[[nominative|<span title="nominative case" style="color:black;"><b><i>nominative</i></b></span>]]'
	end

genitive = args['genitive'] or ''	args['genitive'] = args['genitive'] or ''
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		genitive = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[genitive|<span title="genitive case - γενικὴ πτῶσις" style="color:black;"><b><i>genitive</i></b></span>]]'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		genitive = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[genitive|<span title="genitive case - γενικὴ πτῶσις" style="color:black;"><b><i>genitive</i></b></span>]]'
	elseif args['el'] == '1' then
		genitive = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[genitive|<span title="genitive case - γενική πτώση" style="color:black;"><b><i>genitive</i></b></span>]]'
	else
		genitive = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[genitive|<span title="genitive case" style="color:black;"><b><i>genitive</i></b></span>]]'
	end

dative = args['dative'] or ''	args['dative'] = args['dative'] or ''
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		dative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[dative|<span title="dative case - δοτικὴ πτῶσις" style="color:black;"><b><i>dative</i></b></span>]]'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		dative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[dative|<span title="dative case - δοτικὴ πτῶσις" style="color:black;"><b><i>dative</i></b></span>]]'
			-- normally, not needed at gkm
	elseif args['el'] == '1' then
		dative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[dative|<span title="dative case - δοτική πτώση" style="color:black;"><b><i>dative</i></b></span>]]'
			-- normally, not needed at el
	else
		dative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[dative|<span title="dative case" style="color:black;"><b><i>dative</i></b></span>]]'
	end

accusative = args['accusative'] or ''	args['accusative'] = args['accusative'] or ''
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		accusative = '&nbsp;&nbsp;&nbsp;&nbsp;[[accusative|<span title="accusative case - αἰτιατικὴ πτῶσις" style="color:black;"><b><i>accusative</i></b></span>]]'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		accusative = '&nbsp;&nbsp;&nbsp;&nbsp;[[accusative|<span title="accusative case - αἰτιατικὴ πτῶσις" style="color:black;"><b><i>accusative</i></b></span>]]'
	elseif args['el'] == '1' then
		accusative = '&nbsp;&nbsp;&nbsp;&nbsp;[[accusative|<span title="accusative case - αιτιατική πτώση" style="color:black;"><b><i>accusative</i></b></span>]]'
	else
		accusative = '&nbsp;&nbsp;&nbsp;&nbsp;[[accusative|<span title="accusative case" style="color:black;"><b><i>accusative</i></b></span>]]'
	end

vocative = args['vocative'] or ''	args['vocative'] = args['vocative'] or ''
	if args['grc'] == '1' or args['grc-koi'] == '1' or args['grc-koi'] == '2' then
		vocative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[vocative|<span title="vocative case - κλητικὴ πτῶσις" style="color:black; font-size:90%;"><b><i>vocative</i></b></span>]]'
		.. ' [[ὦ|<span style="color:black;">ὦ</span>]]!'
	elseif args['gkm'] == '1' or args['grk-gkm'] == '1' or args['gkm'] == '2' or args['grk-gkm'] == '2' then
		vocative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[vocative|<span title="vocative case - κλητικὴ πτῶσις" style="color:black; font-size:90%;"><b><i>vocative</i></b></span>]]'
		.. ' [[ὦ|<span style="color:black;">ὦ</span>]]!'
	elseif args['el'] == '1' then
		vocative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[vocative|<span title="vocative case - κλητική πτώση" style="color:black; font-size:90%;"><b><i>vocative</i></b></span>]]'
		.. ' [[ε|<span style="color:black;">ε</span>]]!'
  -- need a default -- no greek tooltip	
	else
		vocative = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[vocative|<span title="vocative case" style="color:black; font-size:90%;"><b><i>vocative</i></b></span>]]'
	end



-- NUMBERS ============================================================
	local hassingular = true		-- (args['sg'] ~= nil)
	local hasplural = true			-- (args['pl'] ~= nil)
	local hasdual = true			-- (args['du'] ~= '-')

	-- num=		The other number does NOT exist and is NOT expected. For pluralia and singularia tantum.
	-- num2=	The other number grammatically exists. For special sense in this number.
	-- SD		yes dual together with singular
	-- PD		yes dual together with plural
	-- get singular and dual
	if args['num'] == "SD" or args['num2'] == "SD" then
		hasplural = false
	end
	-- get singular only
	if args['num'] == "S" or args['num2'] == "S" then							
		hasplural = false
		hasdual = false
	end
	-- get plural and dual
	if args['num'] == "PD" or args['num2'] == "PD" then
		hassingular = false
	end
	-- get plural only
	if args['num'] == "P" or args['num2'] == "P" then
		hassingular = false
		hasdual = false
	end
	



-- TODO number of columns for full rows ?????? may write e.g. columns = '10' and it is ok
	-- cf local columns above
	columns = '10' -- ????
	
-- NOTES & whole LINES ===============================================
    local note = args['note'] or ''				-- notes by editor
    local comment = args['mod-comment'] or ''	-- standard notes by Template
    local appendix = ''			-- standard link to Appendix (by language)
	local append = ''			-- link to gourp, category and specific paradigm at Appendix

-- group is a super-umbrella category if needed for similar declensions
-- Used at specific declension-functions.
    local group = args['group'] or ''
--[=[
    if args['group'] ~= '' and args['group'] ~= nil then
    	if args['group'] == 'συγκοπτόμενα' then
		group = "[[:Category:" .. "Ουσιαστικά συγκοπτόμενα (αρχαία ελληνικά)|συγκοπτόμενα]]," 
		else
    	-- make the group standard index, as cat_decl is
    	group = "[[:Category:" '' lang_name .. 'nouns' .. " inflected like the group '" .. group .. "|group '" .. group .. "']]," 
		end
		-- NEED to WRITE AGAIN at CATEGORIES under if mainspace and under nocat
    end
]=]--

-- cat_decl (κατηγορία κλίσης) NOT for el -category for all 'type' subcategores like pluralia, exceptions, dialects
-- Used at specific declension-functions. E.g. cat-decl like large declensions with many variants στρατιώτης φύλαξ etc
    local cat_decl = args['cat-decl'] or ''
-- test also el, or withdraw
	if args['el'] ~= '' and args['el'] ~= nil then
			if args['cat_decl'] == 'defective' then
	   		cat_decl_str = " [[:Category:Greek defective nouns|Category '" .. cat_decl .. "']]"
    		else
			cat_decl_str = " [[:Category:Greek" .. 'nouns' .. " inflected like '" .. cat_decl .. "|Category '" .. cat_decl .. "']]"
			end
	elseif (args['gkm'] ~= '' and args['gkm'] ~= nil) or (args['grk-gkm'] ~= '' and args['grk-gkm'] ~= nil) then
		cat_decl_str = " [[:Category:Medieval Greek" .. 'nouns' .. " inflected like '" .. cat_decl .. "|Category '" .. cat_decl .. "']]"
	else -- all grc, grc-koi, ancient dialects.
		if args['cat-decl'] == "-" or args['cat-decl'] == '' or args['cat-decl'] == nil then 
		cat_decl_str = '' -- control cat:
		elseif args['cat-decl'] ~= "-" and args['cat-decl'] ~= '' and args['cat-decl'] ~= nil then 
		  	if args['cat-decl'] == 'irregular' then
		  	cat_decl_str = " [[:Category:Ancient Greek irregular nouns|Category '" .. cat_decl .. "']]"
			elseif args['cat_decl'] == 'defective' then
	   		cat_decl_str = " [[:Category:Ancient Greek defective nouns|Category '" .. cat_decl .. "']]"
    		else
    		cat_decl_str = " [[:Category:Ancient Greek nouns inflected like '" .. cat_decl .. "'|Category '" .. cat_decl .. "']]"
			end
		end
   end -- close if el, else if gkm, etc

-- as in =  a link to Appendix's clitic paradigm
    local as_in = args['as in'] or ''
    if as_in ~= '' and as_in ~= nil then
		if args['el'] == '1' then
    		as_in = ' as in «[[Appendix:Greek nouns#' .. as_in .. '|' .. as_in .. ']]»'
    	elseif args['gkm'] == '2' then
    		as_in = ' as in «[[Appendix:Medieval Greek grammar#' .. as_in .. '|' .. as_in .. ']]»'
    	else -- all grc, grc-koi, gkm=1 etc
    		if args['decl'] == 'irregular' or args['decl'] == '0' then
    		as_in = ' as in  «[[Appendix:Ancient Greek nouns#' .. 'Irregular' .. '|' .. as_in .. ']]»'
    		elseif args['decl'] == '2att' then
    		as_in = ' as in  «[[Appendix:Ancient Greek Attic declension#|' .. as_in .. ']]»'
    		elseif args['decl'] == '1' then
    		as_in = ' as in  «[[Appendix:Ancient Greek first declension nouns#' .. as_in .. '|' .. as_in .. ']]»'
    		elseif args['decl'] == '2' then
    		as_in = ' as in  «[[Appendix:Ancient Greek second declension nouns#' .. as_in .. '|' .. as_in .. ']]»'
    		elseif args['decl'] == '3' then
    		as_in = ' as in  «[[Appendix:Ancient Greek third declension nouns#' .. as_in .. '|' .. as_in .. ']]»'
    		end
    	end -- close if language...
    end

-- append WRITE the first part of the appendix line
	if args['decl'] == 'irregular' or args['decl'] == '0' then
		append = '[[Appendix:Ancient Greek nouns#Irregular|irregular]], ' .. group .. cat_decl_str .. as_in .. ' - '
	elseif args['decl'] == '2att' then
		append = '[Appendix:Ancient Greek Attic declension|Attic 2nd declension]], ' .. group .. cat_decl_str .. as_in .. ' - '
	elseif args['decl'] == '1st' or args['decl'] == '2nd' or args['decl'] == '3rd' then
		append = '[[Appendix:Ancient Greek nouns#' .. klisi .. ' declension|' .. klisi .. 'declension]], ' .. group .. cat_decl_str .. as_in .. ' - '
	end


-- ============== note lines / comment, note
-- TODO?? Do I need if 5 columns only??? when only one number?

-- I need thin bar for legend with explanations of flags. Especially for gkm.
	-- See param page, if gkm...

	if args['mod-comment'] ~= '' or args['mod-comment'] ~= nil then -- TODO check or = and?
		if not (args['note'] == nil or mw.ustring.len(args['note']) < 1) then
		note = '|-' .. "\n" .. [=[| colspan="]=] .. columns .. [=[" align="left" style="padding-top:0px; padding-bottom:0px; background:]=] .. c_4 .. [=[; font-size:80%; line-height:100%;" | ]=]
		note = note .. comment .. '<br>' .. args['note'] .. "\n"
		else
		note = '|-' .. "\n" .. [=[| colspan="]=] .. columns .. [=[" align="left" style="padding-top:0px; padding-bottom:0px; background:]=] .. c_4 .. [=[; font-size:80%; line-height:100%;" | ]=]
		note = note .. comment .. "\n"
		end
	end
	if args['mod-comment'] == '' or args['mod-comment'] == nil then
		if not (args['note'] == nil or mw.ustring.len(args['note']) < 1) then
		note = '|-' .. "\n" .. [=[| colspan="]=] .. columns .. [=[" align="left" style="padding-top:0px; padding-bottom:0px; background:]=] .. c_4 .. [=[; font-size:80%; line-height:100%;" | ]=]
		note = note .. args['note'] .. "\n"
		else
		note = ''
		end
	end
	-- appendix
	if args['appendix'] == '-' then appendix = ''
	elseif args['appendix'] ~= '-'  and args['appendix'] ~= '' and args['appendix'] ~= nil  then
		appendix = '|-' .. "\n" .. [=[| colspan="]=] .. columns .. [=[" align="right" style="text-align:right; background:]=] .. c_4 .. [=[; font-size:70%; line-height:100%;" | ]=]
		appendix = appendix .. append .. args['appendix'] .. "\n"
	else
		appendix = '|-' .. "\n" .. [=[| colspan="]=] .. columns .. [=[" align="right" style="text-align:right; background:]=] .. c_4 .. [=[; font-size:70%; line-height:100%;" | ]=]
		appendix = appendix .. append .. '[[Appendix:' .. lang_name .. ' ' .. mw.getContentLanguage():lcfirst(pos) 
		.. '|<span title="Appendix:Nouns">Appendix:' .. lang_name .. ' ' .. mw.getContentLanguage():lcfirst(pos) ..  '</span>]]' .. "\n"
	end



-- CELLS  ============================================================
-- extra title string
	if args['mod-title'] ~= '' and args['mod-title'] ~= nil then
		extratitle_str =  args['mod-title'] .. "\n"
	end
    
-- stem_cell --this is a full row, but it does not come first, it goes UNDER last row
	if args['stems'] ~= '' and args['stems'] ~= nil then
		-- colspan as in columms

		stem_cell = [=[| style="background:]=] .. c_3 .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
		[=["  colspan="]=] .. columns .. [=[" align="left" | ]=] .. args['stems'] .. "\n"
 
	end -- close stem_cell

----------- has singular

-- (spaces added for good copy-paste result)
if hassingular then
	-- for 2 columns only (table_style1's border does not apply)
	if args['num'] == 'S' or args['num2'] == 'S' or args['num'] == 'SD' or args['num2'] == 'SD' then
		c_bordR = c_border
    	
        sg_title_str = [=[! style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[;" colspan="2" align="center"|]=] .. singular .. "\n"

        subtitle_sg = [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:70%; font-style:italic; line-height:100%;" colspan="2" align="center"|]=] .. args['subtitle-sg'] .. "\n"

	else -- different right border
		c_bordR = c_bord -- soft right border if more columns follow
-- ?????????? why not .. args['singular'] .. 	
        sg_title_str =  [=[! style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
[=[;" colspan="2" align="center"|]=] .. singular .. "\n"
 
        subtitle_sg = [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_1 ..
[=[; font-size:70%; font-style:italic; line-height:100%;" colspan="2" align="center"| ]=] .. args['subtitle-sg'] .. "\n"	
	end

		--article nominative singular aNS
        a_nom_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aNS'] ..  "\n"
        nom_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bordR .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['NScell'] ..  "\n"
        a_gen_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aGS'] ..  "\n"
        gen_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bordR .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['GScell'] ..  "\n"
        a_dat_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aDS'] ..  "\n"
        dat_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bordR .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['DScell'] ..  "\n"
        a_acc_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aAS'] ..  "\n"
        acc_sg_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bordR .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['AScell'] ..  "\n"
        a_voc_sg_str = [=[| style="]=] .. font_cell .. fontsize_cell ..  [=[" align="center" | ]=] .. args['aVS'] ..  "\n"
        voc_sg_str = [=[| style="border-right:1px solid ]=] .. c_bordR .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['VScell'] ..  "\n"

end -- close hassingular

----------- has plural
if hasplural then
	-- if 2nd plural follows, right borders are soft
	if args['subtitle-pl2'] ~= '' and args['subtitle-pl2'] ~= nil then
        	
        pl_title_str = [=[! style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
[=[;" colspan="2" align="center"|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number - πληθυντικός αριθμός" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]=] .. "\n"

        subtitle_pl = [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_1 ..
[=[; font-size:70%; font-style:italic; line-height:100%;" colspan="2" align="center"| ]=] .. args['subtitle-pl'] .. "\n"

		--article nominative plural aNP 
        a_nom_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aNP'] ..  "\n"
        nom_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['NPcell'] ..  "\n"
        a_gen_pl_str =  [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aGP'] ..  "\n"
        gen_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['GPcell'] ..  "\n"
        a_dat_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aDP'] ..  "\n"
        dat_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['DPcell'] ..  "\n"
        a_acc_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aAP'] ..  "\n"
        acc_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['APcell'] ..  "\n"
        a_voc_pl_str = [=[| style="]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aVP'] ..  "\n"
        voc_pl_str = [=[| style="border-right:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['VPcell'] ..  "\n"
        
	else -- if 2nd plural does not follow we need strong right borders
        	
        pl_title_str = [=[! style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[;" colspan="2" align="center"|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number - πληθυντικός αριθμός" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]=] .. "\n"

        subtitle_pl = [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border .. 
[=[; font-size:70%; font-style:italic; line-height:100%;" colspan="2" align="center"| ]=] .. args['subtitle-pl'] .. "\n"
        
        a_nom_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aNP'] ..  "\n"
        nom_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['NPcell'] ..  "\n"
        a_gen_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aGP'] ..  "\n"
        gen_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['GPcell'] ..  "\n"
        a_dat_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aDP'] ..  "\n"
        dat_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['DPcell'] ..  "\n"
        a_acc_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aAP'] ..  "\n"
        acc_pl_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['APcell'] ..  "\n"
        a_voc_pl_str = [=[| style="]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['aVP'] ..  "\n"
        voc_pl_str = [=[| style="border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['VPcell'] ..  "\n"
        
	end -- close if 2nd plural
        
end -- close hasplural

-- 2nd singular ------------
		--  DO i need these? YES
		args['a2NS'] = args['a2NS'] or ''
		args['a2GS'] = args['a2GS'] or ''
		args['a2DS'] = args['a2DS'] or ''
		args['a2AS'] = args['a2AS'] or ''
		args['2NScell'] = args['2NScell'] or ''
		args['2GScell'] = args['2GScell'] or ''
		args['2DScell'] = args['2DScell'] or ''
		args['2AScell'] = args['2AScell'] or ''
		args['2VScell'] = args['2VScell'] or ''

--[=[
-- need to open this column whenever there ANY element (word or article)
-- or the general command  subtitle-sg2=... 
	-- a) if any of this exists (oops i have =  '-' too)
--	if (args['subtitle-sg2'] ~= '' and args['subtitle-sg2'] ~= nil)
--	if (args['a2NS'] ~= '' and args['a2NS'] ~= nil) or (args['a2GS'] ~= '' and args['a2GS'] ~= nil)
--	or (args['a2DS'] ~= '' and args['a2DS'] ~= nil) or (args['a2AS'] ~= '' and args['a2AS'] ~= nil)
if args['2NS'] ~= '' and args['2NS'] ~= nil then errorhere('what gender?') end
--	if (args['2NScell'] ~= '' and args['2NScell'] ~= nil) or (args['2GScell'] ~= '' and args['2GScell'] ~= nil)
--	or (args['2DScell'] ~= '' and args['2DScell'] ~= nil) or (args['2AScell'] ~= '' and args['2AScell'] ~= nil)
--	or (args['2VScell'] ~= '' and args['2NScell'] ~= nil)
	-- then consider the general command open
--	then
--		args['subtitle-sg2'] = args['subtitle-sg2']
--	end
]=]--

	if (args['subtitle-sg2'] ~= '' and args['subtitle-sg2'] ~= nil)
	then

        sg2_title_str = [=[! style="background:]=] .. c_1 ..
[=[;" colspan="2" align="center"| ]=] .. singular .. "\n"

        subtitle_sg2 = [=[| style="background:]=] .. c_2 ..
[=[; border-right:1px solid ]=] .. c_1 .. [=[; font-size:70%; font-style:italic; line-height:100%;" colspan="2" align="center"| ]=] .. args['subtitle-sg2'] .. "\n"
        
        a_nom_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2NS'] ..  "\n"
        nom_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2NScell'] ..  "\n"
        a_gen_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2GS'] ..  "\n"
        gen_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord  .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2GScell'] ..  "\n"
        a_dat_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2DS'] ..  "\n"
        dat_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2DScell'] ..  "\n"
        a_acc_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2AS'] ..  "\n"
        acc_sg2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord  .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2AScell'] ..  "\n"
        a_voc_sg2_str = [=[| style="]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2VS'] ..  "\n"
        voc_sg2_str = [=[| style="border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2VScell'] ..  "\n"
	end	-- close sg2 exists


-- 2nd plural  ------------
		--  DO i need these? YES
		args['a2NP'] = args['a2NP'] or ''
		args['a2GP'] = args['a2GP'] or ''
		args['a2DP'] = args['a2DP'] or ''
		args['a2AP'] = args['a2AP'] or ''
		args['2NPcell'] = args['2NPcell'] or ''
		args['2GPcell'] = args['2GPcell'] or ''
		args['2DPcell'] = args['2DPcell'] or ''
		args['2APcell'] = args['2APcell'] or ''
		args['2VPcell'] = args['2VPcell'] or ''

-- need to open this column whenever there ANY element (word or article)
-- or the general command  subtitle-pl2=... 

	if (args['subtitle-pl2'] ~= '' and args['subtitle-pl2'] ~= nil)
	then

        pl2_title_str = [=[! style="background:]=] .. c_1 ..
[=[;" colspan="2" align="center"|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[plural|<span title="plural number - πληθυντικός αριθμός" style="color:black;"><b><i>plural</i></b></span>]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]=] .. "\n"

        subtitle_pl2 = [=[| style="background:]=] .. c_2 ..
[=[; border-right:1px solid ]=] .. c_1 .. [=[; font-size:70%; font-style:italic; line-height:100%;" colspan="2" align="center"| ]=] .. args['subtitle-pl2'] .. "\n"
        
        a_nom_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2NP'] ..  "\n"
        nom_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2NPcell'] ..  "\n"
        a_gen_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2GP'] ..  "\n"
        gen_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord  .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2GPcell'] ..  "\n"
        a_dat_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2DP'] ..  "\n"
        dat_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2DPcell'] ..  "\n"
        a_acc_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2AP'] ..  "\n"
        acc_pl2_str = [=[| style="border-bottom:1px solid ]=] .. c_bord  .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2APcell'] ..  "\n"
        a_voc_pl2_str = [=[| style="]=] .. font_cell .. fontsize_cell ..
        [=[" align="center" | ]=] .. args['a2VP'] ..  "\n"
        voc_pl2_str = [=[| style="border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell .. fontsize_cell ..
        [=[" align="left" | ]=] .. args['2VPcell'] ..  "\n"
	end	-- close pl2 exists



if hasdual then -- need lines only for nom, gen
-- yes dual ----------------

-- 2 cols	sing+dual OR plur+dual
	if (args['num'] == 'SD' or args['num2'] == 'SD' or args['num'] == 'PD' or args['num2'] == 'PD') and args['du'] ~= '-'
	and (args['subtitle-sg2'] == '' or args['subtitle-sg2'] == nil)
	and (args['subtitle-pl2'] == '' or args['subtitle-pl2'] == nil)
	then
    	
        du_title_str =  [=[! style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:80%; line-height:100%;" colspan="2" align="center" |[[dual|<span title="dual mumber - δυϊκός ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]]=] .. "\n"
        
        a_nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%;" align="center" colspan="1" | ]=] .. args['aND'] .. "\n"
        nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="1" | ]=] .. args['NDcell'] .. "\n"
        a_gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%;" align="center" colspan="1" | ]=] .. args['aGD'] .. "\n"
        gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="1" | ]=] .. args['GDcell'] .. "\n"
    
-- 4 cols 
	elseif (args['num'] ~= 'SD' and args['num2'] ~= 'SD' and args['num'] ~= 'PD' and args['num2'] ~= 'PD') and args['du'] ~= '-'
	and (args['subtitle-sg2'] == '' or args['subtitle-sg2'] == nil)
	and (args['subtitle-pl2'] == '' or args['subtitle-pl2'] == nil)
	then
        du_title_str =  [=[! style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:80%; line-height:100%;" colspan="4" align="center" |[[dual|<span title="dual mumber - δυϊκός ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]]=] .. "\n"
        
        a_nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="2" | ]=] .. args['aND'] .. '&nbsp;' .. "\n"
        nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="2" | ]=] .. args['NDcell'] .. "\n"
        a_gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="2" | ]=] .. args['aGD'] .. '&nbsp;' .. "\n"
        gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="2" | ]=] .. args['GDcell'] .. "\n"
        
-- 6 cols for  en en2 pl
	elseif (args['num'] ~= 'SD' and args['num2'] ~= 'SD' and args['num'] ~= 'PD' and args['num2'] ~= 'PD') and args['du'] ~= '-'
	and (args['subtitle-sg2'] ~= '' and args['subtitle-sg2'] ~= nil)
	and (args['subtitle-pl2'] == '' or args['subtitle-pl2'] == nil)
	then
        du_title_str =  [=[! style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:80%; line-height:100%;" colspan="6" align="center" |[[dual|<span title="dual mumber - δυϊκός ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]]=] .. "\n"
        
        a_nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="3" | ]=] .. args['aND'] .. '&nbsp;' .. "\n"
        nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="3" | ]=] .. args['NDcell'] .. "\n"
        a_gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="3" | ]=] .. args['aGD'] .. '&nbsp;' .. "\n"
        gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="3" | ]=] .. args['GDcell'] .. "\n"
        
       
-- 6 cols for  en pl pl2
	elseif (args['num'] ~= 'SD' and args['num2'] ~= 'SD' and args['num'] ~= 'PD' and args['num2'] ~= 'PD') and args['du'] ~= '-'
	and (args['subtitle-sg2'] == '' or args['subtitle-sg2'] == nil)
	and (args['subtitle-pl2'] ~= '' and args['subtitle-pl2'] ~= nil)
	then
        du_title_str =  [=[! style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:80%; line-height:100%;" colspan="6" align="center" |[[dual|<span title="dual mumber - δυϊκός ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]]=] .. "\n"
        
        a_nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="3" | ]=] .. args['aND'] .. '&nbsp;' .. "\n"
        nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="3" | ]=] .. args['NDcell'] .. "\n"
        a_gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="3" | ]=] .. args['aGD'] .. '&nbsp;' .. "\n"
        gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="3" | ]=] .. args['GDcell'] .. "\n"
        
       
-- 8 cols for  en en2 pl pl2
	elseif (args['num'] ~= 'SD' and args['num2'] ~= 'SD' and args['num'] ~= 'PD' and args['num2'] ~= 'PD') and args['du'] ~= '-'
	and (args['subtitle-sg2'] ~= '' and args['subtitle-sg2'] ~= nil)
	and (args['subtitle-pl2'] ~= '' and args['subtitle-pl2'] ~= nil)
	then
        du_title_str =  [=[! style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:80%; line-height:100%;" colspan="8" align="center" |[[dual|<span title="dual mumber - δυϊκός ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]]=] .. "\n"
        
        a_nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="4" | ]=] .. args['aND'] .. '&nbsp;' .. "\n"
        nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="4" | ]=] .. args['NDcell'] .. "\n"
        a_gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="4" | ]=] .. args['aGD'] .. '&nbsp;' .. "\n"
        gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="4" | ]=] .. args['GDcell'] .. "\n"

-- 4 cols  for other combinations........ hope it is ok
	else
        du_title_str =  [=[! style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_border ..
[=[; font-size:80%; line-height:100%;" colspan="4" align="center" |[[dual|<span title="dual mumber - δυϊκός ἀριθμός" style="color:black;"><b><i>dual</i></b></span>]]]=].. "\n"
        
        a_nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="2" | ]=] .. args['aND'] .. '&nbsp;' .. "\n"
        nom_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="2" | ]=] .. args['NDcell'] .. "\n"
        a_gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord ..
        [=[; font-size:90%; line-height:100%; text-align:right;" align="right" colspan="2" | ]=] .. args['aGD'] .. '&nbsp;' .. "\n"
        gen_du_str = [=[| style="border-bottom:1px solid ]=] .. c_bord .. [=[; border-right:1px solid ]=] .. c_border .. [=[; ]=] .. font_cell ..
        [=[; font-size:90%; line-height:100%;" align="left" colspan="2" | ]=] .. args['GDcell'] .. "\n"

	end -- close if ... numbers exist
end -- close dual

-- ============================= ROWS
-- extra title
	if args['mod-title'] ~= '' and args['mod-title'] ~= nil then extratitle =
'|-' .. extratitle_str .. "\n" ..   [=[|-]=]
	end

-- stem_line
	if args['stems'] ~= '' and args['stems'] ~= nil then stem_line =
'|-' .. "\n" .. [=[| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 .. [=[; line-height:100%;" align="left"|  ]=] .. "\n" .. stem_cell .. [=[|-]=]
	end


-- subtitle line
	-- sg, pl have different number
	if (args['subtitle-sg'] ~= '' or args['subtitle-pl'] ~= '') then subtitle =
'|-' .. "\n" .. [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_1 ..
[=[; text-align:center; font-size:70%; line-height:100%;" align="center"|  ]=] .. "\n" .. subtitle_sg .. subtitle_pl .. [=[|-]=]
	end
	-- 2 singulars, pl
	if args['subtitle-sg2'] ~= '' and args['subtitle-sg2'] ~= nil then subtitle =
'|-' .. "\n" .. [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_1 ..
[=[; text-align:center; font-size:70%; line-height:100%;" align="center"|  ]=] .. "\n" .. subtitle_sg .. subtitle_sg2 .. subtitle_pl .. [=[|-]=]
	end
	-- sg, 2 plurals
	if args['subtitle-pl2'] ~= '' and args['subtitle-pl2'] ~= nil then subtitle =
'|-' .. "\n" .. [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_1 ..
[=[; text-align:center; font-size:70%; line-height:100%;" align="center"|  ]=] .. "\n" .. subtitle_sg .. subtitle_pl .. subtitle_pl2 .. [=[|-]=]
	end
	-- 2 singulars + 2 plurals
	if args['subtitle-sg2'] ~= '' and args['subtitle-sg2'] ~= nil and args['subtitle-pl2'] ~= '' and args['subtitle-pl2'] ~= nil then subtitle =
'|-' .. "\n" .. [=[| style="background:]=] .. c_2 .. [=[; border-right:1px solid ]=] .. c_1 ..
[=[; text-align:center; font-size:70%; line-height:100%;" align="center"|  ]=] .. "\n" .. subtitle_sg .. subtitle_sg2 .. subtitle_pl .. subtitle_pl2 .. [=[|-]=]
	end	
	
	
	-- output WITHOUT dual
	if args['num'] == 'S' or args['num2'] == 'S' or args['num'] == 'P' or args['num2'] == 'P' or args['du'] == '-' or args['kth'] == '1' or args['kath'] == '1' then
	
	-- + extratitle_str	
	if args['mod-title'] ~= '' and args['mod-title'] ~= nil then
			-- FOR mediaeval GKM output without datives - test [[παλληκάριον]]
			if args['dat'] == '-' then
    output = [=[{| ]=] .. table_style1 .. [=[
|-
| style="background:]=] .. c_extra .. [=[; border-right:1px solid ]=] .. c_extra ..
	[=[; text-align:center; line-height:100%;" align="center" colspan="9" |  ]=] .. extratitle_str ..
	   [=[|-
| style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
	[=[; text-align:center; font-size:90%;" align="center"| &darr;&nbsp;<span title="cases - πτώσεις">''cases''</span> ]=] ..
	"\n" .. sg_title_str.. sg2_title_str .. pl_title_str .. pl2_title_str .. stem_line .. subtitle .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. nominative ..
	"\n" .. a_nom_sg_str .. nom_sg_str .. a_nom_sg2_str .. nom_sg2_str .. a_nom_pl_str .. nom_pl_str .. a_nom_pl2_str .. nom_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. genitive ..
	"\n" .. a_gen_sg_str .. gen_sg_str .. a_gen_sg2_str .. gen_sg2_str .. a_gen_pl_str .. gen_pl_str .. a_gen_pl2_str .. gen_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. accusative ..
	"\n" .. a_acc_sg_str .. acc_sg_str .. a_acc_sg2_str .. acc_sg2_str .. a_acc_pl_str .. acc_pl_str .. a_acc_pl2_str .. acc_pl2_str .. [=[|-
| style="background:]=] .. c_3 ..
	[=[; text-align:right;"|]=] .. vocative ..
	"\n" .. a_voc_sg_str .. voc_sg_str .. a_voc_sg2_str .. voc_sg2_str .. a_voc_pl_str .. voc_pl_str .. a_voc_pl2_str .. voc_pl2_str .. note .. appendix .. [=[|}]=]				
				
				
			else --yes datives (when no dual, yes extratitles)
    output = [=[{| ]=] .. table_style1 .. [=[
|-
| style="background:]=] .. c_extra .. [=[; border-right:1px solid ]=] .. c_extra ..
	[=[; text-align:center; line-height:100%;" align="center" colspan="9" |  ]=] .. extratitle_str ..
	   [=[|-
| style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
	[=[; text-align:center; font-size:90%;" align="center"| &darr;&nbsp;<span title="cases - πτώσεις">''cases''</span> ]=] ..
	"\n" .. sg_title_str.. sg2_title_str .. pl_title_str .. pl2_title_str .. stem_line .. subtitle .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. nominative ..
	"\n" .. a_nom_sg_str .. nom_sg_str .. a_nom_sg2_str .. nom_sg2_str .. a_nom_pl_str .. nom_pl_str .. a_nom_pl2_str .. nom_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. genitive ..
	"\n" .. a_gen_sg_str .. gen_sg_str .. a_gen_sg2_str .. gen_sg2_str .. a_gen_pl_str .. gen_pl_str .. a_gen_pl2_str .. gen_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. dative ..
	"\n" .. a_dat_sg_str .. dat_sg_str .. a_dat_sg2_str .. dat_sg2_str .. a_dat_pl_str .. dat_pl_str .. a_dat_pl2_str .. dat_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. accusative ..
	"\n" .. a_acc_sg_str .. acc_sg_str .. a_acc_sg2_str .. acc_sg2_str .. a_acc_pl_str .. acc_pl_str .. a_acc_pl2_str .. acc_pl2_str .. [=[|-
| style="background:]=] .. c_3 ..
	[=[; text-align:right;"|]=] .. vocative ..
	"\n" .. a_voc_sg_str .. voc_sg_str .. a_voc_sg2_str .. voc_sg2_str .. a_voc_pl_str .. voc_pl_str .. a_voc_pl2_str .. voc_pl2_str .. note .. appendix .. [=[|}]=]
		end -- close if dat=-
	else -- no extratitle_str
			-- FOR mediaeval GKM output without datives when no dual, no extratitles - test [[παλληκάριον]]
			if args['dat'] == '-' then
		
    output = [=[{| ]=] .. table_style1 .. [=[
|-
| style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
	[=[; text-align:center; font-size:90%;" align="center"| &darr;&nbsp;<span title="cases - πτώσεις">''cases''</span> ]=] ..
	"\n" .. sg_title_str.. sg2_title_str .. pl_title_str .. pl2_title_str .. stem_line .. subtitle .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. nominative ..
	"\n" .. a_nom_sg_str .. nom_sg_str .. a_nom_sg2_str .. nom_sg2_str .. a_nom_pl_str .. nom_pl_str .. a_nom_pl2_str .. nom_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. genitive ..
	"\n" .. a_gen_sg_str .. gen_sg_str .. a_gen_sg2_str .. gen_sg2_str .. a_gen_pl_str .. gen_pl_str .. a_gen_pl2_str .. gen_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. accusative ..
	"\n" .. a_acc_sg_str .. acc_sg_str .. a_acc_sg2_str .. acc_sg2_str .. a_acc_pl_str .. acc_pl_str .. a_acc_pl2_str .. acc_pl2_str .. [=[|-
| style="background:]=] .. c_3 ..
	[=[; text-align:right;"|]=] .. vocative ..
	"\n" .. a_voc_sg_str .. voc_sg_str .. a_voc_sg2_str .. voc_sg2_str .. a_voc_pl_str .. voc_pl_str .. a_voc_pl2_str .. voc_pl2_str .. note .. appendix .. [=[|}]=]
	

			else --yes datives (when no dual, no extratitles)

		
    output = [=[{| ]=] .. table_style1 .. [=[
|-
| style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
	[=[; text-align:center; font-size:90%;" align="center"| &darr;&nbsp;<span title="cases - πτώσεις">''cases''</span> ]=] ..
	"\n" .. sg_title_str.. sg2_title_str .. pl_title_str .. pl2_title_str .. stem_line .. subtitle .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. nominative ..
	"\n" .. a_nom_sg_str .. nom_sg_str .. a_nom_sg2_str .. nom_sg2_str .. a_nom_pl_str .. nom_pl_str .. a_nom_pl2_str .. nom_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. genitive ..
	"\n" .. a_gen_sg_str .. gen_sg_str .. a_gen_sg2_str .. gen_sg2_str .. a_gen_pl_str .. gen_pl_str .. a_gen_pl2_str .. gen_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. dative ..
	"\n" .. a_dat_sg_str .. dat_sg_str .. a_dat_sg2_str .. dat_sg2_str .. a_dat_pl_str .. dat_pl_str .. a_dat_pl2_str .. dat_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. accusative ..
	"\n" .. a_acc_sg_str .. acc_sg_str .. a_acc_sg2_str .. acc_sg2_str .. a_acc_pl_str .. acc_pl_str .. a_acc_pl2_str .. acc_pl2_str .. [=[|-
| style="background:]=] .. c_3 ..
	[=[; text-align:right;"|]=] .. vocative ..
	"\n" .. a_voc_sg_str .. voc_sg_str .. a_voc_sg2_str .. voc_sg2_str .. a_voc_pl_str .. voc_pl_str .. a_voc_pl2_str .. voc_pl2_str .. note .. appendix .. [=[|}]=]
				end -- close if dat=-

	end -- close extratitle_str
		
		
	else -- WITH dual
	
	-- + extratitle_str	
	if args['mod-title'] ~= '' and args['mod-title'] ~= nil then
		
    output = [=[{| ]=] .. table_style1 .. [=[
|-
| style="background:]=] .. c_extra .. [=[; border-right:1px solid ]=] .. c_extra ..
	[=[; text-align:center; line-height:100%;" align="center" colspan="9" |  ]=] .. extratitle_str ..
	   [=[|-
| style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
	[=[; text-align:center; font-size:90%;" align="center"| &darr;&nbsp;<span title="cases - πτώσεις">''cases''</span> ]=] ..
	"\n" .. sg_title_str .. sg2_title_str .. pl_title_str .. pl2_title_str .. stem_line .. subtitle .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. nominative ..
	"\n" .. a_nom_sg_str .. nom_sg_str .. a_nom_sg2_str .. nom_sg2_str .. a_nom_pl_str .. nom_pl_str .. a_nom_pl2_str .. nom_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. genitive ..
	"\n" .. a_gen_sg_str .. gen_sg_str .. a_gen_sg2_str .. gen_sg2_str .. a_gen_pl_str .. gen_pl_str .. a_gen_pl2_str .. gen_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. dative ..
	"\n" .. a_dat_sg_str .. dat_sg_str .. a_dat_sg2_str .. dat_sg2_str .. a_dat_pl_str .. dat_pl_str .. a_dat_pl2_str .. dat_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. accusative ..
	"\n" .. a_acc_sg_str .. acc_sg_str .. a_acc_sg2_str .. acc_sg2_str .. a_acc_pl_str .. acc_pl_str .. a_acc_pl2_str .. acc_pl2_str .. [=[|-
| style="background:]=] .. c_3 ..
	[=[; text-align:right;"|]=] .. vocative ..
	"\n" .. a_voc_sg_str .. voc_sg_str .. a_voc_sg2_str .. voc_sg2_str .. a_voc_pl_str .. voc_pl_str .. a_voc_pl2_str .. voc_pl2_str .. [=[|-
! style="background:]=] .. c_3 .. [=[; border-top:1px solid ]=] .. c_4 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:center; font-size:90%; line-height:100%;" align="center"| &nbsp; ]=] ..
	"\n" .. du_title_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:85%; line-height:100%;"|  <span title="nominative, accusative, dative - πτώσεις ὀνομαστική, αἰτιατική, κλητική" style="color:black;">''nom-acc-voc''</span>]=] ..
	"\n" .. a_nom_du_str .. nom_du_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:85%; line-height:100%;"| <span title="genitive, dative - πτώσεις γενική, δοτική" style="color:black;">''gen-dat''</span>]=] ..
	"\n" .. a_gen_du_str .. gen_du_str .. note .. appendix .. [=[|}]=]
	
	else -- no extratitle_str
		
    output = [=[{| ]=] .. table_style1 .. [=[
|-
| style="background:]=] .. c_1 .. [=[; border-right:1px solid ]=] .. c_2 ..
	[=[; text-align:center; font-size:90%;" align="center"| &darr;&nbsp;<span title="cases - πτώσεις">''cases''</span> ]=] ..
	"\n" .. sg_title_str .. sg2_title_str .. pl_title_str .. pl2_title_str .. stem_line .. subtitle .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. nominative ..
	"\n" .. a_nom_sg_str .. nom_sg_str .. a_nom_sg2_str .. nom_sg2_str .. a_nom_pl_str .. nom_pl_str .. a_nom_pl2_str .. nom_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. genitive ..
	"\n" .. a_gen_sg_str .. gen_sg_str .. a_gen_sg2_str .. gen_sg2_str .. a_gen_pl_str .. gen_pl_str .. a_gen_pl2_str .. gen_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. dative ..
	"\n" .. a_dat_sg_str .. dat_sg_str .. a_dat_sg2_str .. dat_sg2_str .. a_dat_pl_str .. dat_pl_str .. a_dat_pl2_str .. dat_pl2_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:90%;"|]=] .. accusative ..
	"\n" .. a_acc_sg_str .. acc_sg_str .. a_acc_sg2_str .. acc_sg2_str .. a_acc_pl_str .. acc_pl_str .. a_acc_pl2_str .. acc_pl2_str .. [=[|-
| style="background:]=] .. c_3 ..
	[=[; text-align:right;"|]=] .. vocative ..
	"\n" .. a_voc_sg_str .. voc_sg_str .. a_voc_sg2_str .. voc_sg2_str .. a_voc_pl_str .. voc_pl_str .. a_voc_pl2_str .. voc_pl2_str .. [=[|-
! style="background:]=] .. c_3 .. [=[; border-top:1px solid ]=] .. c_4 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:center; font-size:90%; line-height:100%;" align="center"| &nbsp; ]=] ..
	"\n" .. du_title_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:85%; line-height:100%;"|  <span title="nominative, accusative, vocative - πτώσεις ὀνομαστική, αἰτιατική, κλητική" style="color:black;">''nom-acc-voc''</span>]=] ..
	"\n" .. a_nom_du_str .. nom_du_str .. [=[|-
| style="background:]=] .. c_3 .. [=[; border-bottom:1px solid ]=] .. c_4 ..
	[=[; text-align:right; font-size:85%; line-height:100%;"| <span title="genitive, dative - πτώσεις γενική, δοτική" style="color:black;">''gen-dat''</span>]=] ..
	"\n" .. a_gen_du_str .. gen_du_str .. note .. appendix .. [=[|}]=]
	end -- close extratitle_str

	end -- close output if dual exists



--------------------------------------------------------------------------
--                           4. Categories                              --
--------------------------------------------------------------------------
-- TODO
-- Categories only in mainspace
--[=[ test - need to see them
local page = mw.title.getCurrentTitle()
page.name = page.text:match( "^%s*(.-)%s*$" )
if page.namespace == 0 then	-- Categories work only in MAIN namespace
]=]--

-- nocat= 1
-- if (args['nocat'] ~= '' and args['nocat'] ~= nil) or (args['00'] ~= '' and args['00'] ~= nil) then
if args['nocat'] == '1' then -- DO NOT add the following categories - Just give us the table
	output = output
else

	-- category= overrides everything
	if args['category'] ~= '' and args['category'] ~= nil then -- free text for Category
		output = output .. '[[Category:' .. args['category'] .. ']]'
	else

		local group = args['group']	or ''	-- need to write it AGAIN HERE
		if args['group'] ~= '' and args['group'] ~= nil then
		-- see above the appendix line
			if args['group'] == 'syncopated' then
		output = output .. "[[Category:" .. lang_name .. " syncopated nouns]]"
			else
		output = output .. "[[Category:Ancient Greek nouns of the group " .. group .. "]]"
--    	output = output .. "[[Κατηγορία:" .. cat_pos .. " που κλίνονται όπως η ομάδα '" .. group .. "' (" .. lang_name .. ")]]"
			end
		end

--	if args['κατηγορία κλίσης'] ~= "-" and args['κατηγορία κλίσης'] ~= '' and args['κατηγορία κλίσης'] ~= nil then 
    	-- see above the appendix line
    	-- SEE notes & add the category at ΚΑΤΗΓΟΡΙΕΣ under mainspace and uner nocat
    	-- all the neuter plurals:
    if args['gkm'] == '2' then
    	if args['cat-decl'] == '' or args['cat-decl'] == nil then
    		-- do nothgin
    	else
		output = output .. "[[Category:Medieval Greek nouns inflected like '" .. cat_decl .. "]]"
		end
    elseif args['el'] == '1' then
		-- do nothing
	else
		-- all grc, grc-koi, grc-... UNDER αρχαία ελληνικά
    	if args['cat_decl'] == 'irregular'
    	or args['cat_decl'] == 'defective'
    	then
    		if args['el'] == '1' then
		    	output = output .. "[[Category:Greek " .. cat_decl .. " nouns]]"
    		elseif args['gkm'] == '1' or args['grk-gkm'] == '1' then
    			output = output .. "[[Category:Medieval Greek " .. cat_decl .. " nouns]]"
     		else -- all grc, grc-koi
    			output = output .. "[[Category:Ancient Greek " .. cat_decl .. " nouns]]"
    		end
-- no specific cat-decls needed
--    	else
--    		if args['gkm'] == '2' or args['grk-gkm'] == '2' then
--    			output = output .. "[[Category:Medieval Greek nouns of the " .. cat_decl .. " declension]]" 
--    		else -- all grc, grc-koi, gkm=1
-- ALREADY HAVE Category:Ancient Greek first-declension nouns
--    			output = output .. "[[Category:Ancient Greek nouns of the " .. 'Ουσιαστικά' .. " με κλίση όπως το '" .. cat_decl .. "' (" .. 'αρχαία ελληνικά' .. ")]]"
--    		end
    	end
    end -- close if gkm


	end -- close if args['category']


-- ======= EXTRA CATEGORIES: zero is reserved for the module ONLY, not for editors
-- free category, ελεύθερη κατηγορία +part of speech + language
	if args['subcat'] ~= '' and args ['subcat'] ~= nil then
		output = output .. '[[Category:' .. lang_name .. ' ' .. args['subcat'] ..  mw.getContentLanguage():lcfirst(pos) .. ']]'
	end
	if args['subcat1'] ~= '' and args ['subcat1'] ~= nil then
		output = output .. '[[Category:' .. lang_name .. ' ' .. args['subcat1'] ..  mw.getContentLanguage():lcfirst(pos) .. ']]'
	end
	if args['subcat2'] ~= '' and args ['subcat2'] ~= nil then
		output = output .. '[[Category:' .. lang_name .. ' ' .. args['subcat2'] ..  mw.getContentLanguage():lcfirst(pos) .. ']]'
	end
	-- for Module use ONLY 
	if args['subcat0'] ~= '' and args ['subcat0'] ~= nil then
		output = output .. '[[Category:' .. lang_name .. ' ' .. args['subcat0'] ..  mw.getContentLanguage():lcfirst(pos) .. ']]'
	end
	if args['subcat01'] ~= '' and args ['subcat01'] ~= nil then
		output = output .. '[[Category:' .. lang_name .. ' ' .. args['subcat01'] ..  mw.getContentLanguage():lcfirst(pos) .. ']]'
	end
	if args['subcat02'] ~= '' and args ['subcat02'] ~= nil then
		output = output .. '[[Category:' .. lang_name .. ' ' .. args['subcat0'] ..  mw.getContentLanguage():lcfirst(pos) .. ']]'
	end

-- free category + language
	if args['categ'] ~= '' and args['categ'] ~= nil then
			output = output .. '[[Category:' .. lang_name .. ' ' .. args['categ'] .. ']]'
	end
	if args['categ1'] ~= '' and args['categ1'] ~= nil then
			output = output .. '[[Category:' .. lang_name .. ' ' .. args['categ1'] .. ']]'
	end
	if args['categ2'] ~= '' and args['categ2'] ~= nil then
			output = output .. '[[Category:' .. lang_name .. ' ' .. args['categ2'] .. ']]'
	end
	-- for module use ONLY
	if args['categ0'] ~= '' and args['categ0'] ~= nil then
			output = output .. '[[Category:' .. lang_name .. ' ' .. args['categ0'] .. ']]'
	end
	if args['categ01'] ~= '' and args['categ01'] ~= nil then
			output = output .. '[[Category:' .. lang_name .. ' ' .. args['categ01'] .. ']]'
	end
	if args['categ02'] ~= '' and args['categ02'] ~= nil then
			output = output .. '[[Category:' .. lang_name .. ' ' .. args['categ02'] .. ']]'
	end


-- free category, NO LANGUAGE no restrictions, write free text
	if args['cat-extra'] ~= '' and args['cat-extra'] ~= nil then
			output = output .. '[[Category:' .. args['cat-extra'] .. ']]'
	end
	if args['cat-extra1'] ~= '' and args['cat-extra1'] ~= nil then
			output = output .. '[[Category:' .. args['cat-extra1'] .. ']]'
	end
	if args['cat-extra2'] ~= '' and args['cat-extra2'] ~= nil then
			output = output .. '[[Category:' .. args['cat-extra2'] .. ']]'
	end
	-- for module use ONLY
	if args['cat-extra0'] ~= '' and args['cat-extra0'] ~= nil then
			output = output .. '[[Category:' .. args['cat-extra0'] .. ']]'
	end
	if args['cat-extra01'] ~= '' and args['cat-extra01'] ~= nil then
			output = output .. '[[Category:' .. args['cat-extra01'] .. ']]'
	end
	if args['cat-extra02'] ~= '' and args['cat-extra02'] ~= nil then
			output = output .. '[[Category:' .. args['cat-extra02'] .. ']]'
	end


end -- close in nocat=1

-- end -- close 'if namespace'
-- !!FAILTEST put at main page: if args['GS'] then args['GS'] = frame:preprocess(args['GS']) or '' end

return output -- close fulltable

end

----------------------------------------------------------------------------------------
--                  GENERAL PATTERNS of DECLENSIONS
-----------------------------------------------------------------------------------------

--------------------------------5. DECL--------------------------------------
-- decl - it creates functions for specific declensions at the function pages
-- otherwise, it is EXACTLY like free
-----------------------------------------------------------------------------
decl = function(args)	-- creates functions at the subpages pages

-- all the declension parameters & functions: ======================
require ('Module:User:Sarri.greek/grk-nouns-decl/param').param (args)
-- !!TEST put at main page: if args['GS'] then args['GS'] = frame:preprocess(args['GS']) or '' end
--no--args['GS'] = frame:preprocess(args['GS']) or ''
--if args['GS'] then args['GS'] = frame:preprocess(args['GS']) or '' end
------------
return fulltable(args)
end




--------------------------------------------------------------------------
--            CREATE a DECLENSION TABLE directly at lemma page          --
--------------------------------------------------------------------------
-- invoke directly from pages -- use with caution; better created a function

export.free = function(frame)
--local args = frame:getParent().args	-- for Templates
local args = frame.args		-- invoke

-- all the declension parameters & functions: ======================
require ('Module:User:Sarri.greek/grk-nouns-decl/param').param (args)
-- !!TEST put at main page: if args['GS'] then args['GS'] = frame:preprocess(args['GS']) or '' end
if args['GS'] then args['GS'] = frame:preprocess(args['GS']) or '' end
------------
return fulltable(args) .. '[[Category:manual declensions grk]]'
end


--------------------------------------------------------------------------
--           SPECIFIC TEMPLATES
--------------------------------------------------------------------------

-- may created pages /1, /2, /3, /4



return export