Module:names: Difference between revisions

no edit summary
(Created page with "local m_languages = require("Module:languages") local m_links = require("Module:links") local m_utilities = require("Module:utilities") local m_table = require("Module:table")...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
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 60: Line 40:
local param_mods = {"t", "alt", "tr", "ts", "pos", "lit", "id", "sc", "g", "q", "eq"}
local param_mods = {"t", "alt", "tr", "ts", "pos", "lit", "id", "sc", "g", "q", "eq"}
local param_mod_set = m_table.listToSet(param_mods)
local param_mod_set = m_table.listToSet(param_mods)
local function track(page)
require("Module:debug").track("names/" .. page)
end




Line 324: Line 299:
suffix = from
suffix = from
end
end
end
if unrecognized then
track("unrecognized from")
track("unrecognized from/" .. from)
end
end
return prefix, suffix
return prefix, suffix
Line 458: Line 429:
table.insert(textsegs,
table.insert(textsegs,
(dimtype and dimtype .. " " or "") ..
(dimtype and dimtype .. " " or "") ..
"[[diminutive]]" ..
"[[wikt:diminutive|diminutive]]" ..
(xlittext ~= "" and ", " .. xlittext .. "," or "") ..
(xlittext ~= "" and ", " .. xlittext .. "," or "") ..
" of the ")
" of the ")
Line 466: 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 name|given names]]" or
table.insert(textsegs, numdims > 1 and "[[wikt:given name|given names]]" or
"[[given name]]")
"[[wikt:given name|given name]]")
local need_comma = false
local need_comma = false
if numdims > 0 then
if numdims > 0 then
Line 549: Line 520:
local function insert_cats_gender(g)
local function insert_cats_gender(g)
if g == "unknown-gender" then
if g == "unknown-gender" then
track("unknown gender")
return
return
end
end
Line 678: 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|diminutive]]")
elseif args.aug then
elseif args.aug then
table.insert(textsegs, " [[augmentative]]")
table.insert(textsegs, " [[wikt:augmentative|augmentative]]")
end
end
table.insert(textsegs, " ")
table.insert(textsegs, " ")