پودمان:R:Strong's

از ویکی‌واژه

توضیحات این پودمان می‌تواند در پودمان:R:Strong's/توضیحات قرار گیرد.

local export = {}

function is_polytonic(txt)
	return require("Module:scripts").findBestScript(txt, require("Module:languages").getByCode("grc")):getCode() == "polytonic"
end


function export.strongs(frame)
	local m_scripts = require("Module:scripts")
	local he = require("Module:languages").getByCode("he")
	local grc = require("Module:languages").getByCode("grc")
	
	local args = frame:getParent().args
	local title = args['w'] or mw.title.getCurrentTitle().text
	local title_span = is_polytonic(title) and '<span class="polytonic" lang="grc">'..title..'</span>' or title

	if  mw.title.getCurrentTitle().nsText == "Template" then
		-- pass
	elseif m_scripts.findBestScript(title, he):getCode() == "Hebr" then
		error('Arguments for language and Strong’s Number are required for Hebrew word disambiguation.')
	elseif m_scripts.findBestScript(title, grc):getCode() == "polytonic" then
		local strongs_concordance_numbers_G = mw.loadData("Module:R:Strong's/grc-data")
		local number = strongs_concordance_numbers_G[title]
		if number then
			return "G" .. number
		else
			error('The term “' .. title .. '” does not have a Strong’s number.')
		end
	else
		error('The term “' .. title .. '” is not in polytonic or Hebrew script.')
	end
end

return export