Module:getn: Difference between revisions

2,219 bytes added ,  26 November 2024
no edit summary
No edit summary
No edit summary
 
(23 intermediate revisions by 2 users not shown)
Line 36: Line 36:
codes["aq"] = {type = "gender", cat = "aquatic POS", display = '<abbr title="aquatic class">aq</abbr>'}
codes["aq"] = {type = "gender", cat = "aquatic POS", display = '<abbr title="aquatic class">aq</abbr>'}
codes["ter"] = {type = "gender", cat = "terrestrial POS", display = '<abbr title="terrestrial class">ter</abbr>'}
codes["ter"] = {type = "gender", cat = "terrestrial POS", display = '<abbr title="terrestrial class">ter</abbr>'}
-- Noun classes for Gwaxol
codes["hum"] = {type = "gender", cat = "human POS", display = '<abbr title="human class">hum</abbr>'}
codes["anim1"] = {type = "gender", cat = "animate 1 POS", display = '<abbr title="animate class 1">anim 1</abbr>'}
codes["anim2"] = {type = "gender", cat = "animate 2 POS", display = '<abbr title="animate class 2">anim 2</abbr>'}
codes["inan1"] = {type = "gender", cat = "inanimate 1 POS", display = '<abbr title="inanimate class 1">inan 1</abbr>'}
codes["inan2"] = {type = "gender", cat = "inanimate 2 POS", display = '<abbr title="inanimate class 2">inan 2</abbr>'}
-- Noun classes for Wascotl
codes["div"] = {type = "gender", cat = "divine POS", display = '<abbr title="divine class">d</abbr>'}
codes["hum"] = {type = "gender", cat = "human POS", display = '<abbr title="human class">h</abbr>'}
codes["org"] = {type = "gender", cat = "organic POS", display = '<abbr title="organic class">o</abbr>'}
codes["anim"] = {type = "gender", cat = "animate POS", display = '<abbr title="animate class">a</abbr>'}
codes["inan"] = {type = "gender", cat = "inanimate POS", display = '<abbr title="inanimate class">i</abbr>'}
-- Noun classes for Jokelang 2
codes["us"] = {type = "gender", cat = "American POS", display = '<abbr title="American gender">us</abbr>'}
codes["uk"] = {type = "gender", cat = "British POS", display = '<abbr title="British gender">uk</abbr>'}
-- Noun classes for Berfesian
codes["snt"] = {type = "gender", cat = "Sentient POS", display = '<abbr title="Sentient gender">snt</abbr>'}
codes["zo"] = {type = "gender", cat = "Zoic POS", display = '<abbr title="Zoic gender">zo</abbr>'}
codes["abs"] = {type = "gender", cat = "Abstract POS", display = '<abbr title="Abstract gender">abs</abbr>'}
codes["elm"] = {type = "gender", cat = "Elemental POS", display = '<abbr title="Elemental gender">elm</abbr>'}


-- Animacy
-- Animacy
Line 55: Line 75:
codes["d"] = {type = "number", display = '<abbr title="dual number">du</abbr>'}
codes["d"] = {type = "number", display = '<abbr title="dual number">du</abbr>'}
codes["p"] = {type = "number", cat = "pluralia tantum", display = '<abbr title="plural number">pl</abbr>'}
codes["p"] = {type = "number", cat = "pluralia tantum", display = '<abbr title="plural number">pl</abbr>'}
codes["pa"] = {type = "number", display = '<abbr title="paucal number">pa</abbr>'}
codes["ol"] = {type = "number", display = '<abbr title="collective number">col</abbr>'}


-- Verb qualifiers
-- Verb qualifiers
codes["impf"] = {type = "aspect", cat = "imperfective POS", display = '<abbr title="imperfective aspect">impf</abbr>'}
codes["impf"] = {type = "aspect", cat = "imperfective POS", display = '<abbr title="imperfective aspect">impf</abbr>'}
codes["pf"] = {type = "aspect", cat = "perfective POS", display = '<abbr title="perfective aspect">pf</abbr>'}
codes["pf"] = {type = "aspect", cat = "perfective POS", display = '<abbr title="perfective aspect">pf</abbr>'}
-- Soc'ul'
codes["acc"] = {type = "aspect", cat = "accusative POS", display = '<abbr title="accusative aligned">ᴀᴄᴄ</abbr>'}
codes["erg"] = {type = "aspect", cat = "ergative POS", display = '<abbr title="ergative aligned">ᴇʀɢ</abbr>'}


-- Combined codes that are equivalent to giving multiple specs. `mf` is the same as specifying two separate specs,
-- Combined codes that are equivalent to giving multiple specs. `mf` is the same as specifying two separate specs,
Line 70: Line 95:
local codetype_cats = {}
local codetype_cats = {}
codetype_cats["gender"] = "POS with multiple genders"
codetype_cats["gender"] = "POS with multiple genders"
codetype_cats["animacy"] = "POS with multiple animacies"
codetype_cats["animacy"] = "ambiguous POS"
codetype_cats["aspect"] = "biaspectual POS"
codetype_cats["aspect"] = "biaspectual POS"


Line 132: Line 157:
local typ = codes[code].type
local typ = codes[code].type
if typ ~= "other" and types[typ] then
if typ ~= "other" and types[typ] then
--require("Module:debug").track("gender and number/multiple")
--require("Module:debug").track("gender and number/multiple/" .. spec)
error('The gender specification "' .. spec.spec .. '" contains multiple tags of type "' .. typ .. '".')
error('The gender specification "' .. spec.spec .. '" contains multiple tags of type "' .. typ .. '".')
end
end
Line 179: Line 202:
local text
local text
if code == "?" then
if code == "?" then
text = '<abbr class="noun-class" title="noun class missing">?</abbr>'
text = '<abbr class="noun-class" style="font-style: italic;" title="noun class missing">?</abbr>'
else
else
text = '<abbr class="noun-class" title="noun class ' .. code .. '">' .. code .. "</abbr>"
text = '<abbr class="noun-class" style="font-style: italic;" title="noun class ' .. code .. '">' .. code .. "</abbr>"
if lang and pos_for_cat then
if lang and pos_for_cat then
table.insert(categories, lang:getCanonicalName() .. " class " .. code .. " POS")
table.insert(categories, lang:getCanonicalName() .. " class-" .. code .. " POS")
end
end
end
end
Line 285: Line 308:
if is_nounclass then
if is_nounclass then
-- Add the processed codes together with slashes
-- Add the processed codes together with slashes
return '<span class="gender">class ' .. table.concat(formatted_specs, "/") .. "</span>", categories
return '<span class="gender" style="font-style: italic;">class ' .. table.concat(formatted_specs, "/") .. "</span>", categories
else
else
-- Add the processed codes together with " or "
-- Add the processed codes together with " or "
return '<span class="gender">' .. table.concat(formatted_specs, " or ") .. "</span>", categories
return '<span class="gender" style="font-style: italic;">' .. table.concat(formatted_specs, " or ") .. "</span>", categories
end
end
end
end


return export
return export
2,558

edits