Modül:zh-kat

Vikisözlük sitesinden
Modül belgelemesi [Oluştur]


local export = {}

local m_zh = require("Modül:zh")

local conventional_names = {
	["beginning"] = "Beginning Mandarin",
	["elementary"] = "Elementary Mandarin",
	["intermediate"] = "Intermediate Mandarin",
	["advanced"] = "Advanced Mandarin",
	["antonymous"] = "Çince antonymous compounds",
	["disyllabic"] = "Çince disyllabic morphemes",
	["variant"] = "Çince variant forms",
	["simplified"] = "Çince simplified forms",
	["obsolete"] = "Çince obsolete terms",
	["wasei kango"] = "Wasei kango",
	["twice-borrowed"] = "Çince twice-borrowed terms",
	["gçt"] = "Çincede Geleneksel Çin tıbbı",
	["phrasebook"] = "Çince phrasebook",
	["kısa"] = "Çince kısa biçimler",
	["genericized trademark"] = "Çince genericized trademarks",
	["taboo"] = "Çince terms arising from taboo avoidance",
	["triplicated"] = "Triplicated Çince characters",
	["duplicated"] = "Duplicated Çince characters",
	["quadruplicated"] = "Quadruplicated Çince characters",
	["stratagem"] = "Thirty-Six Stratagems",
	["juxtapositional idiom"] = "Çince juxtapositional idioms",
	["pseudo-idiom"] = "Çince pseudo-idioms",
	["contranym"] = "Çince contranyms",
	["xiehouyu"] = "Çince xiehouyu",
	["character shape word"] = "Çince terms making reference to character shapes",
	["mandarin günlük"] = "Mandarin dili günlük konuşma dili",

	["reduplicative diminutive nouns"] = "Çince reduplicative diminutive nouns",
	["reduplicative diminutive proper nouns"] = "Çince reduplicative diminutive proper nouns",
	["reduplicative diminutive pronouns"] = "Çince reduplicative diminutive pronouns",
}

function export.generateClsLink(text, doNotUsePagename)
	local trad = doNotUsePagename and text or mw.title.getCurrentTitle().text
	local simp = m_zh.ts(trad)
	return "Kategori:Çince " .. (trad ~= simp and (trad .. "/" .. simp) or trad) .. " tarafından sınıflandırılan adlar"
end
	
function export.categorize(frame)
	local args = type(frame) == "table" and frame:getParent().args or { frame }
	local PAGENAME = mw.title.getCurrentTitle().text
	local sortkey = require("Modül:zh-sıraanahtarı").makeSortKey(PAGENAME)
	local text = ""
	for _, cat in ipairs(args) do
		if mw.ustring.match(cat, "Sınıflandırıcı") then
			local parts = mw.text.split(cat, ":")
			text = text .. "[[" .. export.generateClsLink(parts[2], true) .. "|" .. sortkey .. "]]"
		
		elseif conventional_names[mw.ustring.lower(cat)] then
			text = text .. "[[Kategori:" .. conventional_names[mw.ustring.lower(cat)] .. "|" .. sortkey .. "]]"
		else
			text = text .. "[[Kategori:Çincede " .. cat .. "|" .. sortkey .. "]]"
		end
	end
	return (mw.title.getCurrentTitle().nsText == "" and text or "")
end

function export.clsCat(frame)
	local PAGENAME = mw.title.getCurrentTitle().text
	local part = mw.text.split(PAGENAME, " ")
	local character = part[#part]
	local sortkey = require("Modül:zh-sıraanahtarı").makeSortKey(character)
	return "Çince sınıflandırıcı olarak " .. m_zh.link(frame, nil, { character, tr = "-" }, character) ..
		" karakterini kullanan adlar.\n[[Kategori:Çince sınıflandırıcısına göre adlar|" .. sortkey .. "]]"
end

return export