Module:names: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14: Line 14:


local force_cat = false -- for testing
local force_cat = false -- for testing
--[=[
FIXME:
1. from=the Bible (DONE)
2. origin=18th century [DONE]
3. popular= (DONE)
4. varoftype= (DONE)
5. eqtype= [DONE]
6. dimoftype= [DONE]
7. from=de:Elisabeth (same language) (DONE)
8. blendof=, blendof2= [DONE]
9. varform, dimform [DONE]
10. from=English < Latin [DONE]
11. usage=rare -> categorize as rare?
12. dimeq= (also vareq=?) [DONE]
13. fromtype= [DONE]
14. <tr:...> and similar params [DONE]
]=]


-- version of rsubn() that discards all but the first return value
-- version of rsubn() that discards all but the first return value
Line 449: Line 429:
table.insert(textsegs,
table.insert(textsegs,
(dimtype and dimtype .. " " or "") ..
(dimtype and dimtype .. " " or "") ..
"diminutive" ..
"[[wikt:diminutive]]" ..
(xlittext ~= "" and ", " .. xlittext .. "," or "") ..
(xlittext ~= "" and ", " .. xlittext .. "," or "") ..
" of the ")
" of the ")
Line 457: Line 437:
table.insert(genders, args["or"])
table.insert(genders, args["or"])
table.insert(textsegs, table.concat(genders, " or ") .. " ")
table.insert(textsegs, table.concat(genders, " or ") .. " ")
table.insert(textsegs, numdims > 1 and "given names" or
table.insert(textsegs, numdims > 1 and "[[wikt:given name|given names]]" or
"given name")
"[[wikt:given name]]")
local need_comma = false
local need_comma = false
if numdims > 0 then
if numdims > 0 then
Line 539: Line 519:
end
end
local function insert_cats_gender(g)
local function insert_cats_gender(g)
if g == "unknown-gender" then
return
end
if g ~= "male" and g ~= "female" and g ~= "unisex" then
if g ~= "male" and g ~= "female" and g ~= "unisex" then
error("Unrecognized gender: " .. g)
error("Unrecognized gender: " .. g)
Line 665: Line 648:
table.insert(textsegs, " " .. m_table.serialCommaJoin(nametypes))
table.insert(textsegs, " " .. m_table.serialCommaJoin(nametypes))
if args.dim then
if args.dim then
table.insert(textsegs, " diminutive")
table.insert(textsegs, " [[wikt:diminutive]]")
elseif args.aug then
elseif args.aug then
table.insert(textsegs, " augmentative")
table.insert(textsegs, " [[wikt:augmentative]]")
end
end
table.insert(textsegs, " ")
table.insert(textsegs, " ")