Documentation for this module may be created at Module:la-nouns-decl/τεκμηρίωση

_module = {}
 
bgcolor = 'd9ebff'
titlebgcolor = '#549EA0'
titleptoseiscolor ='#40E0D0'
bordercolor = '#AAAACC'
kataliksicolor = 'DeepPink'
 
-- χρωματισμός κατάληξης
function _xk(kataliksi)
    return '<font style="color:' .. kataliksicolor ..';">' .. kataliksi .. '</font>'
end
 
fulltable2 = function (args)
    local stitlestr = ''
    local ptitlestr = ''
    local onomenstr = ''
    local onomplstr = ''
    local genenstr = ''
    local genplstr = ''
    local dotenstr = ''
    local dotplstr = ''
    local aitenstr = ''
    local aitplstr = ''
    local klenstr = ''
    local klplstr = ''
    local afenstr = ''
    local afplstr = ''
    local paratirisi = ''
    local hassingular = true --(args['εν'] ~= nil)
    if args['α'] == "πλ" then hassingular = false end
    local hasplural = true -- (args['πλ'] ~= nil)
    if args['α'] == "εν" then hasplural = false end
    if not (args['παρατήρηση'] == nil or mw.ustring.len(args['παρατήρηση']) < 1) then        
        --mw.log('para')
        paratirisi = '|-' .. "\n" .. [=[| colspan="4" align="left" style="background:#d9ebff; font-size: 90%; font-style: italic;" | ]=] 
        paratirisi = paratirisi .. args['παρατήρηση'] .. "\n"
    end 
--    if paratirisi == nil then paratirisi =
    if hassingular then
        stitlestr =  [=[! bgcolor="]=] .. titlebgcolor .. [=[" colspan="1" align="center"| '''''[[ενικός]]''''']=] .. "\n"
        onomenstr =  [=[| align="left" |]=] .. args['οε'] ..  "\n"
        genenstr =  [=[| align="left" | ]=] .. args['γε'] ..  "\n"
        dotenstr =  [=[| align="left" | ]=] .. args['δε'] ..  "\n"
        aitenstr =  [=[| align="left" | ]=] .. args['αε'] ..  "\n"
        klenstr =  [=[| align="left" | ]=] .. args['κε'] ..  "\n"
        afenstr =  [=[| align="left" | ]=] .. args['αφε'] ..  "\n"
    end
    if hasplural then
        ptitlestr = '! bgcolor=' .. titlebgcolor .. [=[ colspan="1" align="center"| '''''[[πληθυντικός]]''''']=] .. "\n"
        onomplstr =  [=[| align="left" | ]=] .. args['οπ'] ..  "\n"
        genplstr =  [=[| align="left" | ]=] .. args['γπ'] ..  "\n"
        dotplstr =  [=[| align="left" | ]=] .. args['δπ'] ..  "\n"
        aitplstr =  [=[| align="left" | ]=] .. args['απ'] ..  "\n"
        klplstr =  [=[| align="left" | ]=] .. args['κπ'] ..  "\n"
        afplstr =  [=[| align="left" | ]=] .. args['αφπ'] ..  "\n"
    end
 
    return [=[{| style="float:center;border:1px solid #AAAACC;margin-left:0.5em;margin-bottom:0.5em;text-align:right;" rules="all" cellpadding="3" cellspacing="0"
|-
! bgcolor="]=] .. titlebgcolor .. [=[" | πτώση]=] .. '\n' .. stitlestr .. ptitlestr .. [=[|-
| bgcolor="]=] .. titleptoseiscolor .. [=[" | '''''[[ονομαστική]]''''']=] .. "\n" .. onomenstr .. onomplstr .. [=[|-
| bgcolor="]=] .. titleptoseiscolor .. [=[" | '''''[[γενική]]''''']=] .. "\n" .. genenstr .. genplstr .. [=[|-
| bgcolor="]=] .. titleptoseiscolor .. [=[" | '''''[[δοτική]]''''']=] .. "\n" .. dotenstr .. dotplstr .. [=[|-
| bgcolor="]=] .. titleptoseiscolor .. [=[" | '''''[[αιτιατική]]''''']=] .. "\n" .. aitenstr .. aitplstr .. [=[|-
| bgcolor="]=] .. titleptoseiscolor .. [=[" | '''''[[κλητική]]''''']=] .. "\n" .. klenstr .. klplstr .. [=[|-
| bgcolor="]=] .. titleptoseiscolor .. [=[" | '''''[[αφαιρετική]]''''']=] .. "\n" .. afenstr .. afplstr .. paratirisi .. '|}' 
end
 
------------------
klisi1 = function(args)
    local lemma = ""
    if args['λήμμα'] ~= nil and args['λήμμα'] ~= "" then
        lemma = args['λήμμα']
    else
        PAGENAME = mw.title.getCurrentTitle().text
        --αφαίρεση κενών στην αρχή και στο τέλος
        lemma = PAGENAME:match( "^%s*(.-)%s*$" )
    end
    local stemnumber = 0
    if args['α'] ~= "πλ" then
        stemnumber = tonumber(mw.ustring.len(args['οε']))
    else
        stemnumber = tonumber(mw.ustring.len(args['οπ']))
    end
    local stem = {}
    stem["1"] = mw.ustring.sub(lemma,1,-stemnumber-1)
 
    for  i, ptwsi in ipairs({'οε', 'γε', 'γε2', 'αε', 'δε', 'κε', 'κε2', 'κε0', 'αφε', 'οπ', 'οπ2', 'γπ', 'γπ0', 'γπ2', 'δπ', 'απ', 'απ2', 'αφπ'}) do
       if args[ptwsi .. 'θ'] == nil then args[ptwsi .. 'θ'] = "1" end
    end

    if args['απ'] == nil then 
       args['απ'] = args['οπ']
       args['απθ'] = args['οπθ']
    end
    if args['απ2'] == nil then
       args['απ2'] = args['οπ2']
       args['απθ2'] = args['οπθ2']
    end
    if args['κε'] == nil then args['κε'] = args['αε'] end
 
    args['οε'] = stem[args['οεθ']] .. _xk( args['οε'])
    -- Γενική ενικού
    if (args['γε'] == "-" or args['γε'] == "" or args['γε'] == nil) then
        args['γε'] = ""
    else
        args['γε'] = stem[args['γεθ']] .. _xk( args['γε'])
    end
    if args['γε2'] ~=nil and args['γε2'] ~= "" and args['γε2'] ~= "-" then
        args['γε2'] = "<br />& " .. stem[args['γε2θ']] .. _xk( args['γε2'])
    else 
        args['γε2'] = ''
    end
    args['γε'] = args['γε'] .. args['γε2']

    ----Δοτ - Αφαιρ - Αιτ ενικού
    args['δε'] = stem[args['δεθ']] .. _xk( args['δε'])
    args['αφε'] = stem[args['αφεθ']] .. _xk( args['αφε'])
    args['αε'] = stem[args['αεθ']] .. _xk( args['αε'])
 
    ----ΚΛΗΤΙΚΗ ΕΝΙΚΟΥ
    if args['κε0'] ~= nil then
        args['κε'] = '(' .. stem[args['κε0θ']] .. _xk( args['κε0']) .. ')'
    else
    args['κε'] = stem[args['κεθ']] .. _xk( args['κε'])
    end
    if args['κε2'] ~=nil and args['κε2'] ~= "" and args['κε2'] ~= "-" then
        args['κε2'] = "<br />" .. stem[args['κε2θ']] .. _xk( args['κε2']) .. '*'
    else
        args['κε2'] = ""
    end
    args['κε'] = args['κε'] .. args['κε2']
 
    --Ονομ. πληθ
    args['οπ'] = stem[args['οπθ']] .. _xk( args['οπ'])
    if args['οπ2'] ~=nil and args['οπ2'] ~= "" and args['οπ2'] ~= "-" then
        args['οπ2'] = "<br />& " .. stem[args['οπ2θ']] .. _xk( args['οπ2'])
    else
        args['οπ2'] = ''
    end
    args['οπ'] = args['οπ'] .. args['οπ2']
    args['κπ'] = args['οπ']
 
    --γενική πληθυντικού
    if (args['γπ'] == "-" or args['γπ'] == "" or args['γπ'] == nil) then
        args['γπ'] = ""
    else
        args['γπ'] = stem[args['γπθ']] .. _xk( args['γπ'])
    end
    if args['γπ0'] ~= nil then
        args['γπ'] = '(' .. stem[args['γπ0θ']] .. _xk( args['γπ0']) .. ')'
    end
    if args['γπ2'] ~=nil and args['γπ2'] ~= "" and args['γπ2'] ~= "-" then
        args['γπ2'] = stem[args['γπ2θ']] .. _xk( args['γπ2'])
        if args['γπ'] ~= "" then 
	        args['γπ2'] = "<br />& " .. args['γπ2']
	    end
    else
        args['γπ2'] = ""
    end
    args['γπ'] = args['γπ'] .. args['γπ2']

    --Δοτική πληθ.
    args['δπ'] = stem[args['δπθ']] .. _xk( args['δπ'])

    --Αφαιρετική πληθ.
    args['αφπ'] = stem[args['αφπθ']] .. _xk( args['αφπ'])

    --Αιτιατική πληθ.
    args['απ'] = stem[args['απθ']] .. _xk( args['απ'])
    if args['απ2'] ~=nil and args['απ2'] ~= "" and args['απ2'] ~= "-" then
        args['απ2'] = "<br />& " .. stem[args['απ2θ']] .. _xk( args['απ2'])
    else
        args['απ2'] = ''
    end
    args['απ'] = args['απ'] .. args['απ2']
 
    return fulltable2(args)
end
 
 
-- Εδώ αρχίζουν οι καταλήξεις των επιμέρους προτύπων
 
_module.mensa = function(frame)
    local args = frame:getParent().args
    args['οε'] = "a"
    args['γε'] = "ae"
    args['δε'] = "ae"
    args['αε'] = "am"
    args['κε'] = "a"
    args['αφε'] = "a"
    args['οπ'] = "ae"
    args['γπ'] = "arum"
    args['δπ'] = "is"
    args['απ'] = "as"
    args['κπ'] = "ae"
    args['αφπ'] = "is"
    return frame:preprocess(klisi1(args))
end

return _module