Module:names: Difference between revisions
(this and last edit) support diminutives of classes of names (described using addl=) rather than specific names |
No edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 60: | Line 60: | ||
female = {type = "human"}, | female = {type = "human"}, | ||
unisex = {type = "human", cat = {"male given names", "female given names", "unisex given names"}, article = "a"}, | unisex = {type = "human", cat = {"male given names", "female given names", "unisex given names"}, article = "a"}, | ||
["third-gender"] = {type = "human"}, | |||
["unknown-gender"] = {type = "human", cat = {}, track = true}, | ["unknown-gender"] = {type = "human", cat = {}, track = true}, | ||
animal = {type = "animal", track = true}, | animal = {type = "animal", track = true}, | ||
| Line 67: | Line 68: | ||
horse = {type = "animal"}, | horse = {type = "animal"}, | ||
pig = {type = "animal"}, | pig = {type = "animal"}, | ||
parrot = {type = "animal"} | |||
} | } | ||
| Line 486: | Line 488: | ||
else | else | ||
if spec.props.type == "animal" then | if spec.props.type == "animal" then | ||
text = "[[" .. spec.type .. "]]" | text = "[[wikt:" .. spec.type .. "|" .. spec.type .. "]]" | ||
else | else | ||
text = spec.type | text = spec.type | ||
| Line 610: | Line 612: | ||
added_text = nil | added_text = nil | ||
if numdimofs > 0 then | if numdimofs > 0 then | ||
added_text = (dimoftype and dimoftype .. " " or "") .. "[[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 "") .. "[[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 638: | ||
ins(" ") | ins(" ") | ||
end | end | ||
ins((numdimofs > 1 or numaugofs > 1 or force_plural) and "[[given name|given names]]" or "[[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 922: | ||
ins(adj .. " ") | ins(adj .. " ") | ||
end | end | ||
ins("[[" .. 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,135: | ||
local augdim_text | local augdim_text | ||
if args.dim then | if args.dim then | ||
augdim_text = " [[diminutive]]" | augdim_text = " [[wikt:diminutive|diminutive]]" | ||
elseif args.aug then | elseif args.aug then | ||
augdim_text = " [[augmentative]]" | augdim_text = " [[wikt:augmentative|augmentative]]" | ||
else | else | ||
augdim_text = "" | augdim_text = "" | ||
| Line 1,142: | Line 1,144: | ||
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, "[[" .. 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 [[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 [[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 [[given name]]") | table.insert(nametype_linked, "unisex [[wikt:given name|given name]]") | ||
else | else | ||
table.insert(nametype_linked, nametype) | table.insert(nametype_linked, nametype) | ||