Module:nn-verb-form of

Definition from Wiktionary, the free dictionary
Jump to: navigation, search
Text-x-generic with pencil.svg This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local p = {}
 
function p.link(word, form)
    if word == form then
        link = word
    else
        link = "[[" .. form .. "#Norwegian Nynorsk|" .. form .. "]]"
    end
    link = "'''" .. link .. "'''"
    return link
end
 
function p.main(frame)
    args = frame:getParent().args
    NAMESPACE = mw.title.getCurrentTitle().nsText
    form = args[1] or (NAMESPACE == "Template" and "word") or error("First parameter is missing")
    template = "''" .. form .. " of'' "
 
    if args['no_end'] then
        template = template .. p.link('', args['no_end']) .. ', '
    end
    if args['no_end2'] then
        template = template .. p.link('', args['no_end2']) .. ', '
    end
    if args[2] and args[3] then
        template = template ..  p.link('',  args[2] .. 'a') .. ", " .. p.link('',  args[2] .. 'e') .. ', '
        template = template ..  p.link('',  args[3] .. 'a') .. " ''and'' " .. p.link('',  args[3] .. 'e')
    else
        local args2 = args[2] or (NAMESPACE == "Template" and "word") or error("Second parameter is missing")
        template = template ..  p.link('',  args2  .. 'a') .. " ''and'' " .. p.link('',  args2 .. 'e')
    end
 
    return template
end
 
return p