مندرجات کا رخ کریں

ماڈیول:form of/data

ویکی لغت سے

"اس ماڈیول کی دستاویز ماڈیول:form of/data/دستاویز پر بنائی جاسکتی ہے"

local tags = {}

-- Person
tags["first-person"] = {
	tag_type = "person",
	glossary = "first person",
	shortcuts = {"1"},
}

tags["second-person"] = {
	tag_type = "person",
	glossary = "second person",
	shortcuts = {"2"},
}

tags["third-person"] = {
	tag_type = "person",
	glossary = "third person",
	shortcuts = {"3"},
}

tags["impersonal"] = {
	tag_type = "person",
	glossary = "impersonal",
	shortcuts = {"impers"},
}

-- Number
tags["singular"] = {
	tag_type = "number",
	glossary = "singular number",
	shortcuts = {"s"},
}

tags["dual"] = {
	tag_type = "number",
	glossary = "dual number",
	shortcuts = {"d"},
}

tags["trial"] = {
	tag_type = "number",
	glossary = "trial number",
	shortcuts = {"tr"},
}

tags["paucal"] = {
	tag_type = "number",
	glossary = "paucal number",
	shortcuts = {"pau"},
}

tags["distributive paucal"] = {
	tag_type = "number",
	glossary = "distributive paucal number",
	shortcuts = {"dpau"},
}

tags["جمع"] = {
	tag_type = "number",
	glossary = "plural number",
	shortcuts = {"p", "pl"},
}

tags["singulative"] = {
	tag_type = "number",
	glossary = "singulative number",
	shortcuts = {"sgl"},
}

tags["collective"] = {
	tag_type = "number",
	glossary = "collective number",
	shortcuts = {"col"},
}

-- Gender
tags["masculine"] = {
	tag_type = "gender",
	glossary = "gender",
	shortcuts = {"m"},
}

tags["feminine"] = {
	tag_type = "gender",
	glossary = "gender",
	shortcuts = {"f"},
}

tags["neuter"] = {
	tag_type = "gender",
	glossary = "gender",
	shortcuts = {"n"},
}

tags["common"] = {
	tag_type = "gender",
	glossary = "gender",
	shortcuts = {"c"},
}

tags["virile"] = {
	tag_type = "gender",
	glossary = "virile",
	shortcuts = {"vr"},
}

tags["nonvirile"] = {
	tag_type = "gender",
	glossary = "nonvirile",
	shortcuts = {"nv"},
}

-- Animacy (may be useful sometimes for [[Module:object usage]].)
tags["animate"] = {
	tag_type = "animacy",
	glossary = "animate",
	shortcuts = {"an"},
}

tags["inanimate"] = {
	tag_type = "animacy",
	glossary = "inanimate",
	shortcuts = {"in"},
}

tags["personal"] = {
	tag_type = "animacy",
	shortcuts = {"pr"},
}

-- Tense/aspect
tags["present"] = {
	tag_type = "tense-aspect",
	glossary = "present tense",
	shortcuts = {"pres"},
}

tags["past"] = {
	tag_type = "tense-aspect",
	glossary = "past tense",
}

tags["future"] = {
	tag_type = "tense-aspect",
	glossary = "future tense",
	shortcuts = {"fut", "futr"},
}

tags["non-past"] = {
	tag_type = "tense-aspect",
	glossary = "non-past tense",
	shortcuts = {"npast"},
}

tags["progressive"] = {
	tag_type = "tense-aspect",
	glossary = "progressive",
	shortcuts = {"prog"},
}

tags["preterite"] = {
	tag_type = "tense-aspect",
	shortcuts = {"pret"},
}

tags["perfect"] = {
	tag_type = "tense-aspect",
	glossary = "perfect",
	shortcuts = {"perf"},
}

tags["imperfect"] = {
	tag_type = "tense-aspect",
	glossary = "imperfect",
	shortcuts = {"impf", "imperf"},
}

tags["pluperfect"] = {
	tag_type = "tense-aspect",
	shortcuts = {"plup", "pluperf"},
}

tags["semelfactive"] = {
	tag_type = "tense-aspect",
	shortcuts = {"semf"},
}

tags["aorist"] = {
	tag_type = "tense-aspect",
	glossary = "aorist tense",
	shortcuts = {"aor", "aori"},
}

tags["past historic"] = {
	tag_type = "tense-aspect",
	shortcuts = {"phis"},
}

tags["imperfective"] = {
	tag_type = "tense-aspect",
	glossary = "imperfective",
	shortcuts = {"impfv", "imperfv"},
}

tags["perfective"] = {
	tag_type = "tense-aspect",
	glossary = "perfective",
	shortcuts = {"pfv", "perfv"},
}

-- Mood
tags["imperative"] = {
	tag_type = "mood",
	glossary = "imperative mood",
	shortcuts = {"imp", "impr"},
}

tags["iterative"] = {
	tag_type = "tense-aspect",
	shortcuts = {"iter"},
}

tags["indicative"] = {
	tag_type = "mood",
	glossary = "indicative mood",
	shortcuts = {"ind", "indc", "indic"},
}

tags["subjunctive"] = {
	tag_type = "mood",
	glossary = "subjunctive mood",
	shortcuts = {"sub", "subj"},
}

tags["conditional"] = {
	tag_type = "mood",
	glossary = "conditional mood",
	shortcuts = {"cond"},
}

tags["optative"] = {
	tag_type = "mood",
	glossary = "optative mood",
	shortcuts = {"opta", "opt"},
}

tags["potential"] = {
	tag_type = "mood",
	shortcuts = {"potn"},
}

tags["jussive"] = {
	tag_type = "mood",
	glossary = "jussive mood",
	shortcuts = {"juss"},
}

tags["cohortative"] = {
	tag_type = "mood",
	shortcuts = {"coho", "cohort"},
}

-- Voice
tags["active"] = {
	tag_type = "voice",
	glossary = "active voice",
	shortcuts = {"act", "actv"},
}

tags["middle"] = {
	tag_type = "voice",
	glossary = "middle voice",
	shortcuts = {"mid", "midl"},
}

tags["passive"] = {
	tag_type = "voice",
	glossary = "passive voice",
	shortcuts = {"pass", "pasv"},
}

tags["mediopassive"] = {
	tag_type = "voice",
	glossary = "mediopassive",
	shortcuts = {"mp", "mpsv"},
}

-- Non-finite
tags["infinitive"] = {
	tag_type = "non-finite",
	shortcuts = {"inf"},
}

tags["participle"] = {
	tag_type = "non-finite",
	glossary = "participle",
	shortcuts = {"part", "ptcp"},
}

tags["possessive"] = {
	tag_type = "non-finite",
	shortcuts = {"poss"},
}

tags["negative"] = {
	tag_type = "non-finite",
	shortcuts = {"neg"},
}

tags["connegative"] = {
	tag_type = "non-finite",
	shortcuts = {"conn", "conneg"},
}

tags["supine"] = {
	tag_type = "non-finite",
	glossary = "supine",
	shortcuts = {"sup"},
}

-- Cases
tags["abessive"] = {
	tag_type = "case",
	shortcuts = {"abe"},
}

tags["ablative"] = {
	tag_type = "case",
	glossary = "ablative case",
	shortcuts = {"abl"},
}

tags["absolutive"] = {
	tag_type = "case",
	shortcuts = {"abs"},
}

tags["accusative"] = {
	tag_type = "case",
	glossary = "accusative case",
	shortcuts = {"acc"},
}

tags["adessive"] = {
	tag_type = "case",
	shortcuts = {"ade"},
}

tags["adjectival"] = {
	tag_type = "case",
	shortcuts = {"adj"},
}

tags["adverbial"] = {
	tag_type = "case",
	glossary = "adverbial",
	shortcuts = {"adv"},
}

tags["allative"] = {
	tag_type = "case",
	shortcuts = {"all"},
}

tags["anterior"] = {
	tag_type = "case",
	shortcuts = {"ant"},
}

tags["causal-final"] = {
	tag_type = "case",
	shortcuts = {"cfi", "cfin"},
}

tags["comitative"] = {
	tag_type = "case",
	shortcuts = {"com"},
}

tags["dative"] = {
	tag_type = "case",
	glossary = "dative case",
	shortcuts = {"dat"},
}

tags["delative"] = {
	tag_type = "case",
	shortcuts = {"del"},
}

tags["direct"] = {
	tag_type = "case",
	shortcuts = {"dir"},
}

tags["elative"] = {
	tag_type = "case",
	glossary = "elative case",
	shortcuts = {"ela"},
}

tags["ergative"] = {
	tag_type = "case",
	glossary = "ergative case",
	shortcuts = {"erg"},
}

tags["essive-formal"] = {
	tag_type = "case",
	shortcuts = {"esf", "efor"},
}

tags["essive-modal"] = {
	tag_type = "case",
	shortcuts = {"esm", "emod"},
}

tags["essive"] = {
	tag_type = "case",
	shortcuts = {"ess"},
}

tags["genitive"] = {
	tag_type = "case",
	glossary = "genitive case",
	shortcuts = {"gen"},
}

tags["illative"] = {
	tag_type = "case",
	shortcuts = {"ill"},
}

tags["inessive"] = {
	tag_type = "case",
	shortcuts = {"ine"},
}

tags["instructive"] = {
	tag_type = "case",
	shortcuts = {"ist"},
}

tags["instrumental"] = {
	tag_type = "case",
	glossary = "instrumental case",
	shortcuts = {"ins"},
}

tags["locative"] = {
	tag_type = "case",
	glossary = "locative case",
	shortcuts = {"loc"},
}

tags["nominative"] = {
	tag_type = "case",
	glossary = "nominative case",
	shortcuts = {"nom"},
}

tags["oblique"] = {
	tag_type = "case",
	glossary = "oblique case",
	shortcuts = {"obl"},
}

tags["partitive"] = {
	tag_type = "case",
	glossary = "partitive case",
	shortcuts = {"par"},
}

tags["prepositional"] = {
	tag_type = "case",
	glossary = "prepositional case",
	shortcuts = {"pre", "prep"},
}

tags["sociative"] = {
	tag_type = "case",
	glossary = "sociative case",
	shortcuts = {"soc"},
}

tags["sublative"] = {
	tag_type = "case",
	shortcuts = {"sbl"},
}

tags["superessive"] = {
	tag_type = "case",
	shortcuts = {"spe"},
}

tags["temporal"] = {
	tag_type = "case",
	shortcuts = {"tem", "temp"},
}

tags["terminative"] = {
	tag_type = "case",
	shortcuts = {"ter", "term"},
}

tags["translative"] = {
	tag_type = "case",
	shortcuts = {"tra", "tran"},
}

tags["vocative"] = {
	tag_type = "case",
	glossary = "vocative case",
	shortcuts = {"voc"},
}

-- State
tags["construct"] = {
	tag_type = "state",
	glossary = "construct state",
	shortcuts = {"cons", "construct state"},
}

tags["definite"] = {
	tag_type = "state",
	glossary = "definite",
	shortcuts = {"def", "defn", "definite state"},
}

tags["indefinite"] = {
	tag_type = "state",
	glossary = "indefinite",
	shortcuts = {"indef", "indf", "indefinite state"},
}

tags["attributive"] = {
	tag_type = "state",
	glossary = "attributive",
	shortcuts = {"attr"},
}

-- Sound changes
tags["contracted"] = {
	tag_type = "sound change",
}

-- Other tags
tags["and"] = {
	tag_type = "other",
}

local shortcuts = {}

-- Create the shortcuts list
for name, data in pairs(tags) do
	if data.shortcuts then
		for _, shortcut in ipairs(data.shortcuts) do
			-- If the shortcut is already in the list, then there is a duplicate.
			if shortcuts[shortcut] then
				error("The shortcut \"" .. shortcut .. "\" (for the grammar tag \"" .. name .. "\") conflicts with an existing shortcut for the tag \"" .. shortcuts[shortcut] .. "\".")
			elseif tags[shortcut] then
				error("The shortcut \"" .. shortcut .. "\" (for the grammar tag \"" .. name .. "\") conflicts with an existing tag with that name.")
			end
			
			shortcuts[shortcut] = name
		end
	end
end

return {tags = tags, shortcuts = shortcuts}