模組:Accel/es

維基詞典,自由的多語言詞典

本模块包含西班牙語的新條目建立規則;有關概述,請參見en:WT:ACCEL,有關創建新規則的資訊,請參見en:Module:accel


return {generate = function (params, entry)
	-- special handling for female equivalents
	if params.pos == "名詞" and params.form == "f" then
		entry.head = "{{es-noun|f}}"
		-- definition already correct
		return
	end
	-- special handling for verb forms
	local gerund_verb_spec = params.form:match("^gerund%-(.*)$")
	if gerund_verb_spec then
		entry.head = "{{head|es|動名詞}}"
		entry.def = "{{es-verb form of|" .. gerund_verb_spec .. "}}"
		return
	end
	local verb_spec = params.form:match("^verb%-form%-(.*)$")
	if verb_spec then
		entry.def = "{{es-verb form of|" .. verb_spec .. "}}"
		return
	end
	-- special handling for participles and participle forms
	if params.form == "pp_ms" then
		entry.pos_header = "Participle"
		entry.head = "{{es-past participle}}"
		entry.def = "{{past participle of|es|" .. params.origin .. "}}"
	elseif params.form:find("^pp_") then
		entry.pos_header = "Participle"
		local form_of_template = {pp_fs = "feminine singular of", pp_mp = "masculine plural of", pp_fp = "feminine plural of"}
		local gender = {pp_fs = "f-s", pp_mp = "m-p", pp_fp = "f-p"}
		entry.head = "{{head|es|過去分詞變格形|g=" .. gender[params.form] .. "}}"
		entry.def = "{{" .. form_of_template[params.form] .. "|es|" .. params.target:gsub("[ao]s?$", "o") .. "}}"
	end
end}