Модул:R:LBG

Документацију овог модула можете да направите на страници Модул:R:LBG/док

local export = {}

local tag_greek = require("Module:grc-utilities").tag

local function load_data(w)
    --return mw.loadData("Module:R:LBG/data")[w]
	return require("Module:data tables").index_table("grc_RLBG_lemma_to_index", w)
end

function export.index(frame)
	local params = {
		w = {default = mw.title.getCurrentTitle().text},
		[1] = {},
		[2] = {alias_of = "w"},
	}
	local args = require("Module:parameters").process(frame:getParent().args, params)
	local title = args.w
	local tagged_title = tag_greek(title)
	local number = args[1]
	
	if number then
		return ("[http://stephanus.tlg.uci.edu/lbg/#eid="..number.."&context=lsj "..tagged_title.."] in ")
	else
		local n = load_data(title)
		if n then
			return ("[http://stephanus.tlg.uci.edu/lbg/#eid="..n[1].."&context=lsj "..tagged_title.."] in ")
		else
			return ""
		end
	end
end

return export