Jump to content

Module:List of hieroglyphs

From Wikipedia, the free encyclopedia
local navbar = require("Module:Navbar")._navbar
local p = {}

keys = {
	"A", "B", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "NU",
	"NL", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Aa" }

gardiner_cat = {
    A = "Egyptian hieroglyphs: man and his occupations",
    B = "Egyptian hieroglyphs: woman and her occupations",
    C = "Egyptian hieroglyphs: anthropomorphic deities",
    D = "Egyptian hieroglyphs: parts of the human body",
    E = "Egyptian hieroglyphs: mammals",
    F = "Egyptian hieroglyphs: parts of mammals",
    G = "Egyptian hieroglyphs: birds",
    H = "Egyptian hieroglyphs: parts of birds",
    I = "Egyptian hieroglyphs: amphibious-animals-reptiles-etc",
    K = "Egyptian hieroglyphs: fishes and parts of fishes",
    L = "Egyptian hieroglyphs: invertebrates and lesser animals",
    M = "Egyptian hieroglyphs: trees and plants",
    N = "Egyptian hieroglyphs: sky-earth-water",
    NU = "Egyptian hieroglyphs by category", -- not expected; Upper nile
    NL = "Egyptian hieroglyphs by category", -- not expected; Lower nile
    O = "Egyptian hieroglyphs: buildings and parts-of-buildings-etc",
    P = "Egyptian hieroglyphs: ships and parts of ships",
    Q = "Egyptian hieroglyphs: domestic and funerary furniture",
    R = "Egyptian hieroglyphs: temple furniture and emblems",
    S = "Egyptian hieroglyphs: crowns-dress-staves",
    T = "Egyptian hieroglyphs: warfare-hunting-butchery",
    U = "Egyptian hieroglyphs: agriculture-crafts-and-professions",
    V = "Egyptian hieroglyphs: rope-fiber-baskets-bags",
    W = "Egyptian hieroglyphs: vessels of stone and earthenware",
    X = "Egyptian hieroglyphs: loaves and cakes",
    Y = "Egyptian hieroglyphs: writings-games-music",
    Z = "Egyptian hieroglyphs: strokes, signs derived from Hieratic, geometrical features",
    Aa = "Egyptian hieroglyphs: unclassified"
}

gardiner_desc = {
	A = "Man and his occupations",
    B = "Woman and her occupations",
    C = "Anthropomorphic deities",
    D = "Parts of the human body",
    E = "Mammals",
    F = "Parts of mammals",
    G = "Birds",
    H = "Parts of birds",
    I = "Amphibious animals, reptiles, etc.",
    K = "Fishes and parts of fishes",
    L = "Invertebrata and lesser animals",
    M = "Trees and plants",
    N = "Sky, earth, water",
    NU = "Upper nile",
    NL = "Lower nile",
    O = "Buildings, parts of buildings, etc.",
    P = "Ships and parts of ships",
    Q = "Domestic and funerary furniture",
    R = "Temple furniture and sacred emblems",
    S = "Crowns, dress, staves, etc.",
    T = "Warfare, hunting, butchery",
    U = "Agriculture, crafts, and professions",
    V = "Rope, fibre, baskets, bags, etc.",
    W = "Vessels of stone and earthenware",
    X = "Loaves and cakes",
    Y = "Writings, games, music",
    Z = "Strokes, signs derived from Hieratic, geometrical features",
    Aa = "Unclassified signs"
}

function clc(gardiner)
	local cat = gardiner_cat[gardiner]
	if cat then
		return ("[[:Category:%s]] (%d)"):format(cat, mw.site.stats.pagesInCategory(cat, "all"))
	else return "" end
end

function toc_row(gardiner, link, notes)
	local desc = gardiner_desc[gardiner] or ""
	return "|-\n| '''" .. (gardiner or "Z") .. "'''\n| " .. 
		((link == "no") and desc or
		"[[List of Egyptian hieroglyphs#" .. (gardiner or "Z") .. "|§ " .. desc .. "]]") ..
  -- | style="text-align:right" | {{{number|}}} -->
		"\n| " .. clc(gardiner) .. "\n| " .. (notes or "") .. "\n"
end

p.toc = function(frame)
	local result = {
        "{| class=\"collapsible ", (frame.args.state or "mw-uncollapsed"),
        "\" style=\"font-size:85%; text-align:left;\"\n" .. "|-\n",
        "! colspan=\"3\" style=\"background:#eee\" |",
        navbar { collapsible = "1", "[[Gardiner's sign list|Gardiner's sign list]] letter classification", "Module:List of hieroglyphs" },
        "\n|- style=\"background:#eee\" |\n",
        "! Letter\n",
        "! Description\n",
        "! [[:Category:Egyptian hieroglyphs by category|Category]] <span style=font-weight:normal>(individual hieroglyph articles)</span>\n"
    }
	for _, key in ipairs(keys) do
		table.insert(result, toc_row(key))
	end
	table.insert(result, "|}\n")
	return table.concat(result)
end

return p