Module:snon-headword: Difference between revisions

Melinoë (talk | contribs)
No edit summary
No edit summary
Line 43: Line 43:
["head"] = {list = true, disallow_holes = true},
["head"] = {list = true, disallow_holes = true},
["nomut"] = {type = "boolean"},
["nomut"] = {type = "boolean"},
["type"] = {set = "b,s", required = true},
}
}


Line 84: Line 85:
"m-s", "f-s", "mf-s", "mfbysense-s", "mfequiv-s", "gneut-s", "n-s",
"m-s", "f-s", "mf-s", "mfbysense-s", "mfequiv-s", "gneut-s", "n-s",
"?", "?-p", "?-s"
"?", "?-p", "?-s"
}
-- Extensible table for default plural endings by gender
local default_plural_endings = {
m = "ar",
f = "ir",
-- Easily add more later, e.g., n = "ur"
}
}


Line 104: Line 98:
end
end


-- Extracts the base gender ("m", "f", etc.) ignoring number suffixes like "-p" or "-s"
 
local function get_base_gender(g)
if type(g) == "table" then g = g.spec end
g = g:gsub("%-p$", ""):gsub("%-s$", "")
if g == "mf" then return {"m", "f"} end
if default_plural_endings[g] then return {g} end
return {}
end


local function do_noun(args, data, is_proper)
local function do_noun(args, data, is_proper)
local default_plural_endings = {
m = (args.type == "s" and "e" or "") .. "ar",
f = (args.type == "b" and "á" or "") .. "ir",
}
-- Extracts the base gender ("m", "f", etc.) ignoring number suffixes like "-p" or "-s"
local function get_base_gender(g)
if type(g) == "table" then g = g.spec end
g = g:gsub("%-p$", ""):gsub("%-s$", "")
if g == "mf" then return {"m", "f"} end
if default_plural_endings[g] then return {g} end
return {}
end
local is_plurale_tantum = false
local is_plurale_tantum = false
local category_pos = m_en_util.singularize(data.pos_category)
local category_pos = m_en_util.singularize(data.pos_category)
Line 319: Line 320:
end
end


process_adj_form("comp", "ar", "comparative", "comp")
process_adj_form("comp", (args.type == "s" and "e" or "") .. "ar", "comparative", "comp")
process_adj_form("sup", "ast", "superlative", "sup")
process_adj_form("sup", (args.type == "s" and "e" or "") .. "ast", "superlative", "sup")
end
end
end
end
Line 370: Line 371:
end
end
process_verb_form("pres", "ir", "present")
process_verb_form("pres", (args.type == "b" and "á" or "") .. "ir", "present")
process_verb_form("past", "aidhir", "past")
process_verb_form("past", (args.type == "s" and "e" or "") .. "aidhir", "past")
process_verb_form("fut", "ist", "future")
process_verb_form("fut", (args.type == "b" and "á" or "") .. "ist", "future")
process_verb_form("cond", "aidhist", "conditional")
process_verb_form("cond", (args.type == "s" and "e" or "") .. "aidhist", "conditional")
end
end
end
end