Module:tln-headword: Difference between revisions
No edit summary |
mNo edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 41: | Line 41: | ||
if pl ~= "" then | if pl ~= "" then | ||
text = text .. " | text = text .. " plural '''[[" .. pl .. "]]'''" | ||
if plrom ~= "" then | if plrom ~= "" then | ||
| Line 55: | Line 55: | ||
-- ========================= | -- ========================= | ||
function p.verb(frame) | function p.verb(frame) | ||
local args = | local args = frame:getParent().args | ||
local title = mw.title.getCurrentTitle().text | local title = mw.title.getCurrentTitle().text | ||
local rom = args.rom or "" | local rom = args.rom or "" | ||
local | |||
local pres1 = args.pres1 or "" | |||
local past1 = args.past1 or "" | |||
local part = args.part or "" | |||
local pres1rom = args.pres1rom or "" | |||
local past1rom = args.past1rom or "" | |||
local partrom = args.partrom or "" | |||
local function format_form(form, rom_form) | |||
if form == "" then | |||
return "" | |||
end | |||
local out = "'''[[" .. form .. "]]'''" | |||
if rom_form and rom_form ~= "" then | |||
out = out .. " (" .. rom_form .. ")" | |||
end | |||
return out | |||
end | |||
local text = "'''" .. title .. "'''" | local text = "'''" .. title .. "'''" | ||
text = text .. " | if rom ~= "" then | ||
text = text .. " • (" .. rom .. ")" | |||
end | |||
local parts = {} | |||
if pres1 ~= "" then | |||
table.insert(parts, "first-person singular present " .. format_form(pres1, pres1rom)) | |||
end | |||
if past1 ~= "" then | |||
table.insert(parts, "first-person singular past " .. format_form(past1, past1rom)) | |||
end | |||
if part ~= "" then | |||
table.insert(parts, "past participle " .. format_form(part, partrom)) | |||
end | |||
if | if #parts > 0 then | ||
text = text .. " | text = text .. " (" .. table.concat(parts, ", ") .. ")" | ||
end | end | ||