Module:gender and number: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Created page with "local export = {} local available_genders = { ["n"] = {label = "n", hint = "neuter gender", category = "neuter %", group = "gender"}, ["f"] = {label = "f", hint = "feminine gender", category = "feminine %", group = "gender"}, ["m"] = {label = "m", hint = "masculine gender", category = "masculine %", group = "gender"}, ["c"] = {label = "c", hint = "common gender", category = "common %", group = "gender"}, ["d"] = {label = "du", hint = "dualia tantum", category = "du...")
 
No edit summary
Line 57: Line 57:
local cats = {}
local cats = {}
for _, g_code in ipairs(genders) do
for _, g_code in ipairs(genders) do
local split_codes = combinations[g_code] or mw.text.split(g_code)
local split_codes = combinations[g_code] or mw.text.split(g_code, "-")
for _, split_code in ipairs(split_codes) do
for _, split_code in ipairs(split_codes) do
if split_code == "or" then
if split_code == "or" then
Line 78: Line 78:
end
end
if pos ~= nil then
if pos ~= nil then
for k, v in ipairs(groups) do
for k, v in pairs(groups) do
if type(v) == "number" and v > 1 and multiple_group_categories[k] ~= nil then
if type(v) == "number" and v > 1 and multiple_group_categories[k] ~= nil then
table.insert(cats, "[[Category:" .. language.name .. " " .. string.gsub(multiple_group_categories[k], "%", pos) .. "]]")
table.insert(cats, "[[Category:" .. language.name .. " " .. string.gsub(multiple_group_categories[k], "%", pos) .. "]]")

Navigation menu