Documentation for this module may be created at Module:Nl-conj/doc

-- Scribbled version of Template:nl-conj-wk on en.Wiktionary

local m = {};

function m.conj_wk(frame)
    local args = frame.args
    local stem = args[1]
    local stemE = args[2] or args[1] .. "e"
    local sep = args["sep"] or ""
    local sepSuf = sep ~= "" and " " .. sep or ""
    local dt = args["dt"] or stem:find("[cfhkpqst]$") and "t" or "d"
    local aux = args["aux"] or "hebben"
    local aux2 = args["aux2"]
    local pastPtc = args[3]
    local no_ge = (args["no-ge"] or "") ~= ""
    
    local output =
        "{{nl-conj-table" .. (sep ~= "" and "-sep" or "") ..
        "|title=''{{PAGENAME}}'' (weak in ''-" .. dt .. "'')" ..
        "|{{l|nl|" .. sep .. stemE .. "n}}"

    output = output ..
        -- Present indicative
        "|{{l|nl|" .. sep .. stem .. "}}" ..
        "|{{l|nl|" .. sep .. stem .. "t}}" ..
        "|{{l|nl|" .. sep .. stem .. "t}}" ..
        "|{{l|nl|" .. sep .. stem .. "t}}" ..
        "|{{l|nl|" .. sep .. stem .. "t}}" ..
        "|{{l|nl|" .. sep .. stemE .. "n}}"
        
    output = output ..
        -- Past indicative
        "|{{l|nl|" .. sep .. stem .. dt .. "e}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "e}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "e}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "e}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "e}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "en}}"
    
    output = output ..
        -- Subjunctive
        "|{{l|nl|" .. sep .. stemE .. "}}" ..
        "|{{l|nl|" .. sep .. stemE .. "n}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "e}}" ..
        "|{{l|nl|" .. sep .. stem .. dt .. "en}}"
        
    output = output ..
        -- Imperative
        "|{{l|nl|" .. stem .. sepSuf .. "}}" ..
        "|{{l|nl|" .. stem .. sepSuf .. "t}}"
        
    output = output ..
        -- Participles
        "|{{l|nl|" .. sep .. stemE .. "nd}}" ..
        "|({{l|nl|" .. aux .. "}}" .. (aux2 and "/{{l|nl|" .. aux2 .. "}}" or "") .. ") {{l|nl|" .. sep .. (pastPtc or (no_ge and "" or "ge") .. stem .. dt) .. "}}" ..
        
        "}}"

    return output
end

return m