Pendokumenan untuk modul ini boleh diciptakan di Modul:form of/data/doc

--[=[

This module lists the more common recognized inflection tags, along with their
shortcut aliases, the corresponding glossary entry or page describing the
tag, and the corresponding wikidata entry. The less common tags are in
[[Module:form of/data2]]. We divide the tags this way to save memory space.
Be careful adding more tags to this module; add them to the other module
unless you're sure they are common.

TAGS is a table where keys are the canonical form of an inflection tag and the
corresponding values are tables describing the tags, consisting of the
following keys:
	- tag_type: Type of the tag ("person", "number", "gender", "case",
				"animacy", "tense-aspect", "mood", "voice-valence", etc.).
	- glossary: Anchor or page describing the inflection tag. May be missing.
				If glossary_type is unspecified or is "app", this is an
				anchor in [[Appendix:Glossary]]. If glossary_type is "wikt",
				this is a page in the English Wiktionary. If glossary_type is
				"wp", this is a page in the English Wikipedia. NOTE:
				GLOSSARY ANCHORS ARE PREFERRED. Other types of entries should
				be migrated to the glossary, with links to Wikipedia and/or
				Wiktionary entries as appropriate.
	- glossary_type: Type of the glossary entry. Missing or "app" means
					 an anchor in [[Appendix:Glossary]]; "wikt" means a page
					 in the English Wiktionary; "wp" means a page in the
					 English Wikipedia.
	- shortcuts: List of shortcuts, i.e. aliases for the inflection tag. May be
				 missing.
	- display: If specified, consists of text to display in the definition line,
			   in lieu of the canonical form of the inflection tag. If there is
			   a glossary entry, the displayed text forms the right side of the
			   two-part glossary link.
	- wikidata: Wikidata identifier (see wikidata.org) for the concept most
				closely describing this tag.

SHORTCUTS is a table mapping shortcut aliases to canonical inflection tag names.
Shortcuts are of one of three types:
(1) A simple alias of a tag. These do not need to be entered explicitly into
	the table; code at the end of the module automatically fills in these
	entries based on the information in TAGS.
(2) An alias to a multipart tag. For example, the alias "mf" maps to the
	multipart tag "m//f", which will in turn be expanded into the canonical
	multipart tag {"masculine", "feminine"}, which will display as
	(approximately)
	"[[Appendix:Glossary#gender|masculine]] and [[Appendix:Glossary#gender|feminine]]"
	The number of such aliases should be liminted, and should cover only the
	most common combinations.

	Normally, multipart tags are displayed using serialCommaJoin() in
	[[Module:table]] to appropriately join the display form of the individual
	tags using commas and/or "and". However, some multipart tags are displayed
	specially; see DISPLAY_HANDLERS below. Note that aliases to multipart
	tags can themselves contain simple aliases in them.
(3) An alias to a list of multiple tags (which may themselves be simple or
	multipart aliases). Specifying the alias is exactly equivalent to
	specifying the tags in the list in order, one after another. An example is
	"1s", which maps to the list {"1", "s"}. The number of such aliases should
	be limited, and should cover only the most common combinations.


NOTE: In some cases below, multiple tags point to the same wikidata,
because Wikipedia considers them synonyms. Examples are indirect case vs.
objective case vs. oblique case, and inferential mood vs. renarrative mood.
We do this because (a) we want to allow users to choose their own terminology,
(b) we want to be able to use the terminology most common for the language
in question, (c) terms considered synonyms may or may not actually be
synonyms, as different languages may use the terms differently. For example,
although the Wikipedia page on [[w:Inferential mood]] claims that
inferential and renarrative moods are the same, the page on
[[w:Bulgarian_verbs#Evidentials]] claims that Bulgarian has both, and that
they are not the same.
]=]

local tags = {}
local shortcuts = {}


----------------------- Diri -----------------------

tags["diri pertama"] = {
	tag_type = "diri",
	glossary = "diri pertama",
	shortcuts = {"1"},
	wikidata = "Q21714344",
}

tags["diri kedua"] = {
	tag_type = "diri",
	glossary = "diri kedua",
	shortcuts = {"2"},
	wikidata = "Q51929049",
}

tags["diri ketiga"] = {
	tag_type = "diri",
	glossary = "diri ketiga",
	shortcuts = {"3"},
	wikidata = "Q51929074",
}

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

shortcuts["12"] = "1//2"
shortcuts["13"] = "1//3"
shortcuts["23"] = "2//3"
shortcuts["123"] = "1//2//3"


----------------------- Bilangan -----------------------

tags["mufrad"] = {
	tag_type = "bilangan",
	glossary = "bilangan mufrad",
	shortcuts = {"s", "sg"},
	wikidata = "Q110786",
}

tags["duaan"] = {
	tag_type = "bilangan",
	glossary = "bilangan duaan",
	shortcuts = {"d", "du"},
	wikidata = "Q110022",
}

tags["jamak"] = {
	tag_type = "bilangan",
	glossary = "bilangan jamak",
	shortcuts = {"p", "pl"},
	wikidata = "Q146786",
}

tags["milikan tunggal"] = {
	tag_type = "bilangan",
	glossary = "bilangan mufrad",
	shortcuts = {"spos"},
	wikidata = "Q110786", -- Mufrad
}

tags["milikan berbilang"] = {
	tag_type = "bilangan",
	glossary = "bilangan jamak",
	shortcuts = {"mpos"},
	wikidata = "Q146786", -- Jamak
}

shortcuts["1s"] = {"1", "s"}
shortcuts["2s"] = {"2", "s"}
shortcuts["3s"] = {"3", "s"}
shortcuts["1d"] = {"1", "d"}
shortcuts["2d"] = {"2", "d"}
shortcuts["3d"] = {"3", "d"}
shortcuts["1p"] = {"1", "p"}
shortcuts["2p"] = {"2", "p"}
shortcuts["3p"] = {"3", "p"}


----------------------- Genus -----------------------

tags["maskulin"] = {
	tag_type = "genus",
	glossary = "genus",
	shortcuts = {"m"},
	wikidata = "Q499327",
}

-- Ini berguna contohnya dalam bahasa Sweden.
tags["maskulin semula jadi"] = {
	tag_type = "genus",
	glossary = "genus",
	shortcuts = {"natm"},
}

tags["feminin"] = {
	tag_type = "genus",
	glossary = "genus",
	shortcuts = {"f"},
	wikidata = "Q1775415",
}

tags["neuter"] = {
	tag_type = "genus",
	glossary = "genus",
	shortcuts = {"n"},
	wikidata = "Q1775461",
}

tags["am"] = {
	tag_type = "genus",
	glossary = "genus",
	shortcuts = {"c"},
	wikidata = "Q1305037",
}

tags["bukan kelelakian"] = {
	tag_type = "genus",
	glossary = "bukan kelelakian",
	shortcuts = {"nv"},
}

shortcuts["mf"] = "m//f"
shortcuts["mn"] = "m//n"
shortcuts["fn"] = "f//n"
shortcuts["mfn"] = "m//f//n"


----------------------- Animasi -----------------------

-- (mungkin kadangkala berguna untuk [[Modul:object usage]].)

tags["bernyawa"] = {
	tag_type = "animasi",
	glossary = "bernyawa",
	shortcuts = {"an"},
	wikidata = "Q51927507",
}

tags["tidak bernyawa"] = {
	tag_type = "animasi",
	glossary = "tidak bernyawa",
	shortcuts = {"in", "inan"},
	wikidata = "Q51927539",
}

tags["peribadi"] = {
	tag_type = "animasi",
	shortcuts = {"pr", "pers"},
	wikidata = "Q63302102",
}


----------------------- Kala/aspek -----------------------

tags["kini"] = {
	tag_type = "kala-aspek",
	glossary = "kala kini",
	shortcuts = {"pres"},
	wikidata = "Q192613",
}

tags["lampau"] = {
	tag_type = "kala-aspek",
	glossary = "kala lampau",
	shortcuts = {"past"},
	wikidata = "Q1994301",
}

tags["kelak"] = {
	tag_type = "kala-aspek",
	glossary = "kala kelak",
	shortcuts = {"fut", "futr"},
	wikidata = "Q501405",
}

tags["bukan lampau"] = {
	tag_type = "kala-aspek",
	glossary = "kala bukan lampau",
	shortcuts = {"npast"},
	wikidata = "Q16916993",
}

tags["progresif"] = {
	tag_type = "kala-aspek",
	glossary = "progresif",
	shortcuts = {"prog"},
	wikidata = "Q56653945",
}

tags["kala lampau"] = {
	tag_type = "kala-aspek",
	shortcuts = {"pret"},
	wikidata = "Q442485",
}

tags["sempurna"] = {
	tag_type = "kala-aspek",
	glossary = "sempurna",
	shortcuts = {"perf"},
	wikidata = "Q625420",
}

tags["tidak sempurna"] = {
	tag_type = "kala-aspek",
	glossary = "tidak sempurna",
	shortcuts = {"impf", "imperf"},
}

tags["kala lampau sempurna"] = {
	tag_type = "kala-aspek",
	glossary = "kala lampau sempurna",
	shortcuts = {"plup", "pluperf"},
	wikidata = "Q623742",
}

tags["aorist"] = {
	tag_type = "kala-aspek",
	glossary = "kala aorist",
	shortcuts = {"aor", "aori"},
	wikidata = "Q216497",
}

tags["bersejarah lampau"] = {
	tag_type = "kala-aspek",
	shortcuts = {"phis"},
	wikidata = "Q442485",  -- Kala lampau
}

tags["aspek tidak sempurna"] = {
	tag_type = "kala-aspek",
	glossary = "aspek tidak sempurna",
	shortcuts = {"impfv", "imperfv"},
	wikidata = "Q371427",
}

tags["aspek sempurna"] = {
	tag_type = "kala-aspek",
	glossary = "aspek sempurna",
	shortcuts = {"pfv", "perfv"},
	wikidata = "Q1424306",
}

shortcuts["spast"] = {"selapis", "lampau"}
shortcuts["lampau selapis"] = {"selapis", "lampau"}
shortcuts["spres"] = {"selapis", "kini"}
shortcuts["kini selapis"] = {"selapis", "kini"}


----------------------- Modus -----------------------

tags["imperatif"] = {
	tag_type = "modus",
	glossary = "modus imperatif",
	shortcuts = {"imp", "impr", "impv"},
	wikidata = "Q22716",
}

tags["penyata"] = {
	tag_type = "modus",
	glossary = "modus penyata",
	shortcuts = {"ind", "indc", "indic"},
	wikidata = "Q682111",
}

tags["sembawa"] = {
	tag_type = "modus",
	glossary = "modus sembawa",
	shortcuts = {"sub", "subj"},
	wikidata = "Q473746",
}

tags["bersyarat"] = {
	tag_type = "modus",
	glossary = "modus bersyarat",
	shortcuts = {"cond"},
	wikidata = "Q625581",
}

tags["harapan"] = {
	tag_type = "modus",
	glossary = "modus harapan",
	shortcuts = {"opta", "opt"},
	wikidata = "Q527205",
}

tags["suruh"] = {
	tag_type = "modus",
	glossary = "modus suruf",
	shortcuts = {"juss"},
	wikidata = "Q462367",
}


----------------------- Ragam/Valensi -----------------------

-- This tag type combines what is normally called "voice" (active, passive,
-- middle, mediopassive) with other tags that aren't normally called
-- voice but are similar in that they control the valence/valency (number
-- and structure of the arguments of a verb).
tags["aktif"] = {
	tag_type = "ragam-valensi",
	glossary = "ragam aktif",
	shortcuts = {"act", "actv"},
	wikidata = "Q1317831",
}

tags["tengah"] = {
	tag_type = "ragam-valensi",
	glossary = "ragam tengah",
	shortcuts = {"mid", "midl"},
}

tags["pasif"] = {
	tag_type = "ragam-valensi",
	glossary = "ragam pasif",
	shortcuts = {"pass", "pasv"},
	wikidata = "Q1194697",
}

tags["pasif tengah"] = {
	tag_type = "ragam-valensi",
	glossary = "pasif tengah",
	shortcuts = {"mp", "mpass", "mpasv", "mpsv"},
	wikidata = "Q1601545",
}

tags["kediri"] = {
	tag_type = "ragam-valensi",
	glossary = "kediri",
	shortcuts = {"refl"},
	-- berikut untuk "kata kerja kediri"
	wikidata = "Q13475484",
}

tags["transitif"] = {
	tag_type = "ragam-valensi",
	glossary = "kata kerja transitif",
	shortcuts = {"tr", "vt"},
	-- berikut untuk "kata kerja transitif"
	-- wikidata = "Q1774805",
}

tags["tidak transitif"] = {
	tag_type = "ragam-valensi",
	glossary = "kata kerja tidak transitif",
	shortcuts = {"intr", "vi"},
	-- berikut untuk "kata kerja tidak transitif"
	-- wikidata = "Q1166153",
}

tags["dwitransitif"] = {
	tag_type = "ragam-valensi",
	glossary = "kata kerja dwitransitif",
	shortcuts = {"ditr"},
	-- berikut untuk "kata kerja dwitransitif"
	-- wikidata = "Q2328313",
}

tags["kausatif"] = {
	tag_type = "ragam-valensi",
	glossary = "kausatif",
	shortcuts = {"caus"},
	-- berikut untuk "kata kerja kausatif"
	wikidata = "Q56677011",
}


----------------------- Tidak finit -----------------------

tags["infinitif"] = {
	tag_type = "tidak finit",
	glossary = "infinitif",
	shortcuts = {"inf"},
	wikidata = "Q179230",
}

-- A form found in Portuguese and Galician
-- This is probably unnecessary and can be replaced with the regular "infinitive" tag. A personal infinitive is not a separate infinitive from the plain infinitive, just an inflection of the infinitive.
tags["infinitif peribadi"] = {
	glossary = "konjugasi kata kerja bahasa Portugis",
	glossary_type = "wp",
	tag_type = "tidak finit",
	shortcuts = {"pinf"},
}

tags["partisipel"] = {
	tag_type = "tidak finit",
	glossary = "partisipel",
	shortcuts = {"part", "ptcp"},
	wikidata = "Q814722",
}

tags["kata nama karyaan"] = {
	tag_type = "tidak finit",
	glossary = "kata nama karyaan",
	shortcuts = {"vnoun"},
	wikidata = "Q1350145",
}

tags["gerund"] = {
	tag_type = "tidak finit",
	glossary = "gerund",
	shortcuts = {"ger"},
	wikidata = "Q1923028",
}

tags["supinum"] = {
	tag_type = "tidak finit",
	glossary = "supinum",
	shortcuts = {"sup"},
	wikidata = "Q548470",
}

tags["transgresif"] = {
	tag_type = "tidak finit",
	glossary = "transgresif",
	wikidata = "Q904896",
}


----------------------- Kasus -----------------------

tags["ablatif"] = {
	tag_type = "kasus",
	glossary = "kasus ablatif",
	shortcuts = {"abl"},
	wikidata = "Q156986",
}

tags["akusatif"] = {
	tag_type = "kasus",
	glossary = "kasus akusatif",
	shortcuts = {"acc"},
	wikidata = "Q146078",
}

tags["datif"] = {
	tag_type = "kasus",
	glossary = "kasus datif",
	shortcuts = {"dat"},
	wikidata = "Q145599",
}

tags["genitif"] = {
	tag_type = "kasus",
	glossary = "kasus genitif",
	shortcuts = {"gen"},
	wikidata = "Q146233",
}

tags["perantian"] = {
	tag_type = "kasus",
	glossary = "kasus perantian",
	shortcuts = {"ins"},
	wikidata = "Q192997",
}

tags["lokatif"] = {
	tag_type = "kasus",
	glossary = "kasus lokatif",
	shortcuts = {"loc"},
	wikidata = "Q202142",
}

tags["nominatif"] = {
	tag_type = "kasus",
	glossary = "kasus nominatif",
	shortcuts = {"nom"},
	wikidata = "Q131105",
}

tags["kata depan"] = {
	tag_type = "kasus",
	glossary = "kasus kata depan",
	shortcuts = {"pre", "prep"},
	wikidata = "Q2114906",
}

tags["vokatif"] = {
	tag_type = "kasus",
	glossary = "kasus vokatif",
	shortcuts = {"voc"},
	wikidata = "Q185077",
}


----------------------- Keadaan -----------------------

tags["binaan"] = {
	tag_type = "keadaan",
	glossary = "keadaan binaan",
	display = "keadaan binaan",
	shortcuts = {"cons", "construct state"},
	wikidata = "Q1641446",
}

tags["pasti"] = {
	tag_type = "keadaan",
	glossary = "pasti",
	shortcuts = {"def", "defn", "definite state"},
	wikidata = "Q53997851",
}

tags["tidak pasti"] = {
	tag_type = "keadaan",
	glossary = "tidak pasti",
	shortcuts = {"indef", "indf", "indefinite state"},
	wikidata = "Q53997857",
}

tags["kuat"] = {
	tag_type = "keadaan",
	glossary = "tidak pasti",
	shortcuts = {"str"},
	wikidata = "Q53997857", -- Tidak pasti
}

tags["lemah"] = {
	tag_type = "keadaan",
	glossary = "pasti",
	shortcuts = {"wk"},
	wikidata = "Q53997851", -- Pasti
}

tags["campuran"] = {
	tag_type = "keadaan",
	glossary = "campuran",
	shortcuts = {"mix"},
	wikidata = "Q63302161",
}

tags["atribut"] = {
	tag_type = "keadaan",
	glossary = "atribut",
	shortcuts = {"attr"},
}

tags["predikat"] = {
	tag_type = "keadaan",
	glossary = "predikat",
	shortcuts = {"pred"},
}


----------------------- Darjah perbandingan -----------------------

tags["perbandingan positif"] = {
	tag_type = "perbandingan",
	glossary = "positif",
	shortcuts = {"posd", "positive"},
	-- Tidak wujud dalam bahasa Inggeris; hanya dalam bahasa Czech, Estonia, Finland dan
	-- pelbagai bahasa Nordik.
	wikidata = "Q3482678",
}

tags["darjah bandingan"] = {
	tag_type = "perbandingan",
	glossary = "bandingan",
	shortcuts = {"comd", "comparative"},
	wikidata = "Q14169499",
}

tags["darjah penghabisan"] = {
	tag_type = "perbandingan",
	glossary = "penghabisan",
	shortcuts = {"supd", "superlative"},
	wikidata = "Q1817208",
}


----------------------- Laras bahasa -----------------------

----------------------- Deiksis -----------------------

----------------------- Klusiviti -----------------------

----------------------- Golongan fleksi -----------------------

tags["kata ganti"] = {
	tag_type = "golongan",
	glossary = "kata ganti",
	glossary_type = "wikt",
	shortcuts = {"pron"},
	-- berikut untuk "atribut kata ganti", hanya wujud dalam Wikipedia bahasa Romania
	wikidata = "Q12721180",
}


----------------------- Sikap -----------------------

-- This is a vague tag type grouping augmentative, diminutive and pejorative,
-- which generally indicate the speaker's attitude towards the object in
-- question (as well as often indicating size).

tags["agam"] = {
	tag_type = "sikap",
	shortcuts = {"aug"},
	wikidata = "Q1358239",
}

tags["diminutif"] = {
	tag_type = "sikap",
	shortcuts = {"dim"},
	wikidata = "Q108709",
}

tags["pejoratif"] = {
	tag_type = "sikap",
	shortcuts = {"pej"},
	wikidata = "Q545779",
}


----------------------- Perubahan bunyi -----------------------

tags["terkecut"] = {
	tag_type = "perubahan bunyi",
	wikidata = "Q126473",
}


----------------------- Tatabahasa lain-lain -----------------------

tags["selapis"] = {
	tag_type = "tatabahasa",
	shortcuts = {"sim"},
}

tags["pendek"] = {
	tag_type = "tatabahasa",
}

tags["panjang"] = {
	tag_type = "tatabahasa",
}

tags["bentuk"] = {
	tag_type = "tatabahasa",
}

tags["sifatan"] = {
	tag_type = "tatabahasa",
	glossary = "sifatan",
	glossary_type = "wikt",
	shortcuts = {"adj"},
}

tags["adverbaan"] = {
	tag_type = "tatabahasa",
	glossary = "adverbaan",
	shortcuts = {"adv"},
}

tags["nafi"] = {
	tag_type = "tatabahasa",
	shortcuts = {"neg"},
	glossary = "pengakuan dan penafian",
	glossary_type = "wp",
	wikidata = "Q63302088",
}

tags["milik"] = {
	tag_type = "tidak finit",
	shortcuts = {"poss"},
	wikidata = "Q2105891",
}

tags["dinamakan"] = {
	tag_type = "tatabahasa",
	shortcuts = {"nomz"},
	wikidata = "Q4683152", -- masukan untuk "kata sifat dinamakan"
}

tags["penamaan"] = {
	tag_type = "tatabahasa",
	shortcuts = {"nomzn"},
	wikidata = "Q1500667",
}

tags["akar"] = {
	tag_type = "tatabahasa",
	wikidata = "Q111029",
}

tags["dasar"] = {
	tag_type = "tatabahasa",
	wikidata = "Q210523",
}

tags["bebas"] = {
	tag_type = "tatabahasa",
	shortcuts = {"dep"},
	wikidata = "Q1122094", -- masukan untuk "klausa bebas"
}

tags["tidak bebas"] = {
	tag_type = "tatabahasa",
	shortcuts = {"indep"},
	wikidata = "Q1419215", -- masukan untuk "klausa tidak bebas"
}


----------------------- Tanda lain -----------------------

-- This consists of non-content words like "and" as well as
-- punctuation characters. If the punctuation characters appear
-- by themselves as tags, we special-case the handling of
-- surrounding spaces so the output looks correct.

tags["dan"] = {
	tag_type = "lain",
}

tags[","] = {
	tag_type = "lain",
	no_space_on_left = true,
}

tags[":"] = {
	tag_type = "lain",
	no_space_on_left = true,
}

tags["/"] = {
	tag_type = "lain",
	no_space_on_left = true,
	no_space_on_right = true,
}

tags["("] = {
	tag_type = "lain",
	no_space_on_right = true,
}

tags[")"] = {
	tag_type = "lain",
	no_space_on_left = true,
}

tags["["] = {
	tag_type = "lain",
	no_space_on_right = true,
}

tags["]"] = {
	tag_type = "lain",
	no_space_on_left = true,
}

tags["-"] = { -- tanda sempang-tolak biasa
	tag_type = "other",
	no_space_on_left = true,
	no_space_on_right = true,
}


----------------------- Cipta senarai pintas -----------------------

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}

-- For Vim, so we get 4-space tabs
-- vim: set ts=4 sw=4 noet: