A modult a Modul:accel/eo/doc lapon tudod dokumentálni
return {generate = function (params, entry)
local index = params.origin:find(" de ")
-- Get word before " de "
local usub = mw.ustring.sub
local word = index and params.origin:sub(1, index - 1) or params.origin
local stem = usub(word, 1, -2)
local ending = usub(word, -1)
if ending == "j" then
stem = "original=" .. params.origin .. "|"
ending = usub(word, -2, -2)
end
if index then
stem = "original=" .. params.origin .. "|"
end
if not ("aio"):find(ending) then
return error("The Esperanto word \"" .. params.origin .. "\" does not end in -o or -a or -i or -oj or -aj (index = " .. index .. ", word = " .. word .. ", stem = " .. stem .. ", ending = " .. ending .. ").")
end
if ending == "i" then
ending = ""
end
local formparam = {
= "n|unc=yes",
= "j" .. (params.pos == "proper noun" and "-proper" or ""),
= "n" .. (params.pos == "proper noun" and "-properpl" or ""),
= "jn" .. (params.pos == "proper noun" and "-properpl" or ""),
= "as",
= "is",
= "os",
= "us",
= "u",
}
local inflection = formparam or params.form
if params.pos ~= "proper noun" then
entry.head = "{{eo-head}}"
end
local participle_ending = inflection:match("n?t(j?n?)$")
if participle_ending then
-- Two or three letters long.
-- Alternative: participle_ending:match("(j?n?)$") ~= ""
if #participle_ending >= 2 then
entry.head = "{{eo-part}}"
else -- One letter long.
if participle_ending == "a" then
entry.pos_header = "Adjective"
elseif participle_ending == "e" then
entry.pos_header = "Adverb"
elseif participle_ending == "o" then
entry.pos_header = "Noun"
end
end
end
entry.def = "{{eo-form of|" .. stem .. "|" .. ending .. inflection .. "}}"
end}