Module:Es-conj/table

local paradigms = require('Module:es-conj/data/paradigms')
 
local export = {}

function export.create(frame, args, forms, combined)
	local ending = args[1]
	local pattern = args[2]
	local stems = args[3]
	local ref = args[4]

	local ending_data = deepcopy(require("Module:es-conj/data/"..ending))
	local pattern_data = deepcopy(require("Module:es-conj/data/"..ending))
	if pattern ~= ending then
		pattern_data = deepcopy(require("Module:es-conj/data/"..ending.."/"..pattern))
	end

	local defective = pattern_data.defective
	if not defective then
		defective = {}
	end
	
	local defective_t = {}
	for k1,v1 in pairs(defective) do
		defective_t[v1] = true
	end
	
	if (ending ~= pattern) then
		local template_name = paradigms[ending][pattern]
		
		if (mw.ustring.sub(template_name, 1, 3) == ending) then
			template_name = mw.ustring.sub(template_name, 5, mw.ustring.len(template_name))
		end
		
		if (mw.ustring.sub(template_name, 1, 1) == '(') then
			template_name = mw.ustring.sub(template_name, 2, mw.ustring.len(template_name)-1)
		end
		
		local footer = frame:expandTemplate({title = "Wt/sco/Spanish conjugation type",
									         args = {[1] = ending, [2] = template_name}})
	
		forms["footer"] = "Other verbs with this conjugation: "..footer
	else
		forms["footer"] = ""
	end
	
	if (defective_t[69]) then
		forms["d69"] = defective_t[69]
	end
	if (defective_t[70]) then
		forms["d70"] = defective_t[70]
	end
	if (defective_t[71]) then
		forms["d71"] = defective_t[71]
	end
	if (defective_t[72]) then
		forms["d72"] = defective_t[72]
	end
	if (defective_t[73]) then
		forms["d73"] = defective_t[73]
	end
	
	if (ending ~= pattern) then
		for k1,v1 in pairs(pattern_data.patterns) do
			forms["i"..k1] = true
		end
	end
	
	if (ending ~= pattern) then
		forms["data_url"] = ending .. '/' .. mw.ustring.gsub(pattern, "%s+", "_")
	else
		forms["data_url"] = ending
	end
	
	local result =  frame:expandTemplate({title = "Module:es-conj/templates/es-conj",
		                         args = forms})
		                         
	if combined then
		if ref then
			result = result.."\n"..frame:expandTemplate({title = "Module:es-conj/templates/es-conj-combined-refl", args = combined})
		else
			result = result.."\n"..frame:expandTemplate({title = "Module:es-conj/templates/es-conj-combined", args = combined})
		end
	end
	
	return result
	
end

return export

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.