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

From Wiktionary, the free dictionary
Jump to navigation Jump to search

-- 2024.03.06. [[wikt:en:User:Sarri.greek]]
-- tests of Greek nouns Ancient-Koine-Medieval-Modern

export = {}
 
 
 local function translit(frame)
--	local args = frame:getParent().args	-- for Templates
	local args = frame.args				-- invoke
-- it says it needs 'local'
	local x = ''
	return '<br><span style="white-space:nowrap; font-size:83%; letter-spacing:4px; line-height:100%; color:#777777;">{{xlit|' .. lang_iso .. '|' .. term .. '}}</span>'
--	return '<div style="white-space:nowrap; font-size:83%; letter-spacing:4px; line-height:100%; color:#777777;">{{xlit|' .. 'el' .. '|' .. term .. '}}</div>'
--	x = '<div style="white-space:nowrap; font-size:83%; letter-spacing:4px; line-height:100%; color:#777777;">{{xlit|' .. lang_iso .. '|' .. term .. '}}</div>'
-- ?? where do i write translit = frame:preprocess(translit)
end

--================================== Empty table (for grc, etc)
export['grk-noun'] = function(frame)	-- [[User:Sarri.greek/template4]] = [[Template:grk-decl-noun]]
	local args = frame:getParent().args	-- for Templates
--	local args = frame.args				-- invoke
-- lemma
	local lemma = args['lemma'] or ''
	PAGENAME = mw.title.getCurrentTitle().text
	if lemma  == '' or lemma == nil then args['lemma'] = PAGENAME:match( "^%s*(.-)%s*$" ) 
		else lemma = args['lemma']
	end
-- stems
	-- manually
-- languages grc=1, grc-koi=1 gkm=1 el=1
	-- /param page

-- compulsory: fix article for gender absence
	args['aNS'] = args['aNS'] or ''	
--!!TEST
--if args['GS'] then args['GS'] = frame:preprocess(args['GS']) end
	args['aGS'] = args['aGS'] or ''	
	args['aDS'] = args['aDS'] or ''	args['aAS'] = args['aAS'] or ''
	args['aNP'] = args['aNP'] or ''	args['aGP'] = args['aGP'] or ''
	args['aDP'] = args['aDP'] or ''	args['aAP'] = args['aAP'] or ''
	args['aND'] = args['aND'] or ''	args['aGD'] = args['aGD'] or ''
return decl(args)
end

-- [[User:Sarri.greek/template4]]
--  ======================= TEST el articles  [[στρατός]] ===================================== --
--Lua error in Module:User:Sarri.greek/grk-nouns-decl at line 709: attempt to concatenate field 'aNS' (a nil value)
	-- it cannot see [[Module:User:Sarri.gree/el-articles]]
	-- because I have require with if el=1

export['τεστ'] = function(frame)		-- Template
	local args = frame:getParent().args
	args['el'] = '1'

-- lemma
	local lemma = args['lemma'] or ''
	PAGENAME = mw.title.getCurrentTitle().text
	if lemma  == '' or lemma == nil then args['lemma'] = PAGENAME:match( "^%s*(.-)%s*$" )	-- trim empty spaces from beginning and end. Found at all Modules.
		else lemma = args['lemma']
	end
-- stems
	-- is default, 2 letters from end	

--	args['decl'] = ''
	args['m'] = '1'
--	args['cat-decl']  = 'ναός'
--	args['type'] = 'ναός'
	args['as in'] = 'ναός'
--	args['subcat01'] = 'oxytone'
--	args['subcat02'] = 'masculine oxytone'
--args['mod-NSstem'] = '' --mw.ustring.sub(args['lemma'],1,-3)
	args['mod-NSsuf'] = "ός"
--!!TEST preprocessed template (/main page, function decl) GS= for tlse 	
-- works with PAGNEMAE
--args['GS'] = '{{Template:User:Sarri.greek/tlse|el|{{Template:User:Sarri.greek/word-minus-2end|lemma={{{lemma|}}}}}|ού}}'
--args['GS'] =  frame:preprocess(args['GS'])
	args['mod-GSsuf'] = "ού"
--	args['mod-DSsuf'] = "ώ" -- this is non existant
	args['mod-ASsuf'] = "ό"
	args['mod-VSsuf'] = "έ"
	args['mod-NPsuf'] = "οί"
	args['mod-GPsuf'] = "ών" -- check also polytonic, see what happens with translit
	args['mod-APsuf'] = "ούς"
	args['mod-VPsuf'] = args['mod-NPsuf'] -- as in nominative

--transliteration = transliteration or ''
--transliteration = '<br><span style="white-space:nowrap; font-size:83%; letter-spacing:4px; line-height:100%; color:#777777;">{{xlit|el|' .. args['mod-NSstem'] .. args['mod-NSsuf'] .. '}}</span>'
--translit = frame:preprocess(translit)
--args['mod-NStr'] = frame:preprocess(args['mod-NStr'])
return decl(args)
end

-- 
--  ======================= gkm2 [[παπάς]] ===================================== --
export['παπάς'] = function(frame)
	local args = frame:getParent().args	-- for Templates

--	local args = frame.args				-- invoke
	args['gkm'] = '2'

-- lemma
	local lemma = args['lemma'] or ''
	PAGENAME = mw.title.getCurrentTitle().text
	if lemma  == '' or lemma == nil then args['lemma'] = PAGENAME:match( "^%s*(.-)%s*$" )	-- trim empty spaces from beginning and end. Found at all Modules.
		else lemma = args['lemma']
	end
-- stems
	local stem = {}
    if args['num'] == "P" or args['num2'] == "P" then
    	-- παπ-άδες
     	stem["s"] = mw.ustring.sub(args['lemma'],1,-5) -- stemnumber = 5 (minus 4 letters from end)
    else
    	stem["s"] = mw.ustring.sub(args['lemma'],1,-3) -- stemnumber = 3 (minus 2 letters from end)
    end
    
	stem["s0"] = m_stems_grk.word0(stem["s"])		-- remove accent if exists
	stem["s1"] = m_stems_grk.word1(stem["s0"])		-- put OKSEIA at the last syllable from end of the unaccented

--	args['decl'] = ''
	args['m'] = '1'
--	args['cat-decl']  = 'παπάς'
--	args['type'] = 'παπάς'
	args['as in'] = 'παπάς'
--	args['subcat01'] = 'oxytone'
--	args['subcat02'] = 'masculine oxytone'
	args['mod-NSstem'] = stem["s"]	args['mod-NSsuf'] = "άς"
	args['mod-NStr'] = '{{xlit|el|' ..term ..  '}}'
	args['mod-NS2stem'] = stem["s"]	args['mod-NS2suf'] = "ᾶς"
	args['mod-NS2tr'] = '{{xlit|el|' .. term ..  '}}'
	args['mod-GSstem'] = stem["s"]	args['mod-GSsuf'] = "ᾶ"
	args['mod-ASstem'] = stem["s"]	args['mod-ASsuf'] = "ά"
	args['mod-AS2stem'] = stem["s"]	args['mod-A2Ssuf'] = "άν"
	args['mod-VSstem'] = stem["s"]	args['mod-VSsuf'] = "ά"
	args['mod-NPstem'] = stem["s"] .. "άδ"	args['mod-NPsuf'] = "ες"
--	args['mod-NPtr'] = '{{xlit|el|' .. stem["s"] .. "άδες" ..  '}}'
	args['mod-GPstem'] = stem["s"] .. "άδ"	args['mod-GPsuf'] = "ων"
	args['mod-GP2stem'] = stem["s1"] .. "ηδ"	args['mod-GP2suf'] = "ων"
	args['mod-APstem'] = stem["s"] .. "άδ"	args['mod-APsuf'] = "ες"
	args['mod-AP2stem'] = stem["s"] .. "άδ"	args['mod-AP2suf'] = "ας"
	args['mod-AP2txt'] = '<br>{{Template:User:Sarri.greek/tlse|el|' .. stem["s"] .. "|άς" ..  '|rare=1}}'
	args['mod-VPstem'] = args['mod-NPstem']	args['mod-VPsuf'] = args['mod-NPsuf'] -- as in nominative
--args = frame:preprocess(args)
--if args ~= '' and args ~= nil then return frame:preprocess(export['παπάς']) end
--args['mod-AP2txt'] = frame:preprocess(args['mod-AP2txt'])
return frame:preprocess(decl(args))
--return decl(args)
end




--[=[
--  ======================= 1st decl ANCIENT [[στρατιά]] ===================================== --
export['τεστ'] = function(frame)		-- [[Πρότυπο:grc-κλίση-'στρατιά']]
	local args = frame:getParent().args
	args['grc'] = '1'
-- lemma
	local lemma = args['lemma'] or ''
	PAGENAME = mw.title.getCurrentTitle().text
	if lemma  == '' or lemma == nil then args['lemma'] = PAGENAME:match( "^%s*(.-)%s*$" )	-- trim empty spaces from beginning and end. Found at all Modules.
		else lemma = args['lemma']
	end
-- stems
	local stem = {}
	if args['num'] == "P" or args['num2'] == "P" or args['num'] == "PD" or args['num2'] == "PD" then
     	stem["s"] = mw.ustring.sub(args['lemma'],1,-3) -- στρατι-ές -- minus 2 letters from end, stemnumber=3
    else
    	stem["s"] = mw.ustring.sub(args['lemma'],1,-2) -- στρατι-ά -- minus 1 letter from end, stemnumber=3
    end

--	args['decl'] = '1'
	args['m'] = '1'
    args['cat-decl']  = 'στρατιά'
--	args['type'] = 'στρατιά'
	args['as in'] = 'στρατιά'
--	args['subcat01'] = 'oxytone'
--	args['subcat02'] = 'feminine oxytone'
	args['mod-NSstem'] = stem["s"]		args['mod-NSsuf'] = "ά"	args['mod-NSsuf+'] = "ᾱ́"
	args['mod-GSstem'] = stem["s"]		args['mod-GSsuf'] = "ᾶς"
	args['mod-DSstem'] = stem["s"]		args['mod-DSsuf'] = "ᾷ"
	args['mod-ASstem'] = stem["s"]		args['mod-ASsuf'] = "άν"	args['mod-ASsuf+'] = "ᾱ́ν"
	args['mod-VSstem'] = stem["s"]		args['mod-VSsuf'] = "ά"	args['mod-VSsuf+'] = "ᾱ́"	-- or, as in nom
	args['mod-NPstem'] = stem["s"]		args['mod-NPsuf'] = "αί"
	args['mod-GPstem'] = stem["s"]		args['mod-GPsuf'] = "ῶν"
	args['mod-DPstem'] = stem["s"]		args['mod-DPsuf'] = "αῖς"
	args['mod-APstem'] = stem["s"]		args['mod-APsuf'] = "άς"	args['mod-APsuf+'] = "ᾱ́ς"
	args['mod-VPstem'] = args['mod-NPstem']	args['mod-VPsuf'] = args['mod-NPsuf']				-- as in nominative
	args['mod-NDstem'] = stem["s"]		args['mod-NDsuf'] = "ά"	args['mod-NDsuf+'] = "ᾱ́"
	args['mod-GDstem'] = stem["s"]		args['mod-GDsuf'] = "αῖν"
return decl(args)
end
]=]--



return export