Module:names: Difference between revisions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 67: | Line 67: | ||
horse = {type = "animal"}, | horse = {type = "animal"}, | ||
pig = {type = "animal"}, | pig = {type = "animal"}, | ||
parrot = {type = "animal"} | |||
} | } | ||
| Line 486: | Line 487: | ||
else | else | ||
if spec.props.type == "animal" then | if spec.props.type == "animal" then | ||
text = "[[wikt:" .. spec.type .. "]]" | text = "[[wikt:" .. spec.type .. "|" .. spec.type .. "]]" | ||
else | else | ||
text = spec.type | text = spec.type | ||
| Line 610: | Line 611: | ||
added_text = nil | added_text = nil | ||
if numdimofs > 0 then | if numdimofs > 0 then | ||
added_text = (dimoftype and dimoftype .. " " or "") .. "[[wikt:diminutive|]]" .. | added_text = (dimoftype and dimoftype .. " " or "") .. "[[wikt:diminutive|diminutive]]" .. | ||
(xlittext ~= "" and ", " .. xlittext .. "," or "") .. " of " | (xlittext ~= "" and ", " .. xlittext .. "," or "") .. " of " | ||
elseif numaugofs > 0 then | elseif numaugofs > 0 then | ||
added_text = (augoftype and augoftype .. " " or "") .. "[[wikt:augmentative|]]" .. | added_text = (augoftype and augoftype .. " " or "") .. "[[wikt:augmentative|augmentative]]" .. | ||
(xlittext ~= "" and ", " .. xlittext .. "," or "") .. " of " | (xlittext ~= "" and ", " .. xlittext .. "," or "") .. " of " | ||
end | end | ||
| Line 636: | Line 637: | ||
ins(" ") | ins(" ") | ||
end | end | ||
ins((numdimofs > 1 or numaugofs > 1 or force_plural) and "[[wikt:given name|given names]]" or "[[wikt:given name|]]") | ins((numdimofs > 1 or numaugofs > 1 or force_plural) and "[[wikt:given name|given names]]" or "[[wikt:given name|given name]]") | ||
article = article or "a" -- if no article set yet, it's "a" based on "given name" | article = article or "a" -- if no article set yet, it's "a" based on "given name" | ||
if langcode == "en" then | if langcode == "en" then | ||
| Line 920: | Line 921: | ||
ins(adj .. " ") | ins(adj .. " ") | ||
end | end | ||
ins("[[wikt:" .. iargs.type .. "]]") | ins("[[wikt:" .. iargs.type .. "|" .. iargs.type .. "]]") | ||
local need_comma = false | local need_comma = false | ||
if xlittext ~= "" then | if xlittext ~= "" then | ||
| Line 1,133: | Line 1,134: | ||
local augdim_text | local augdim_text | ||
if args.dim then | if args.dim then | ||
augdim_text = " [[wikt:diminutive|]]" | augdim_text = " [[wikt:diminutive|diminutive]]" | ||
elseif args.aug then | elseif args.aug then | ||
augdim_text = " [[wikt:augmentative|]]" | augdim_text = " [[wikt:augmentative|augmentative]]" | ||
else | else | ||
augdim_text = "" | augdim_text = "" | ||
| Line 1,142: | Line 1,143: | ||
for _, nametype in ipairs(args["type"]) do | for _, nametype in ipairs(args["type"]) do | ||
if nametype == "surname" or nametype == "patronymic" then | if nametype == "surname" or nametype == "patronymic" then | ||
table.insert(nametype_linked, "[[wikt:" .. nametype .. "|]]") | table.insert(nametype_linked, "[[wikt:" .. nametype .. "|" .. nametype .. "]]") | ||
elseif nametype == "male given name" then | elseif nametype == "male given name" then | ||
table.insert(nametype_linked, "male [[wikt:given name|]]") | table.insert(nametype_linked, "male [[wikt:given name|given name]]") | ||
elseif nametype == "female given name" then | elseif nametype == "female given name" then | ||
table.insert(nametype_linked, "female [[wikt:given name|]]") | table.insert(nametype_linked, "female [[wikt:given name|given name]]") | ||
elseif nametype == "unisex given name" then | elseif nametype == "unisex given name" then | ||
table.insert(nametype_linked, "unisex [[wikt:given name|]]") | table.insert(nametype_linked, "unisex [[wikt:given name|given name]]") | ||
else | else | ||
table.insert(nametype_linked, nametype) | table.insert(nametype_linked, nametype) | ||