モジュール:he-links

出典: フリー多機能辞典『ウィクショナリー日本語版(Wiktionary)』
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール:he-links/doc に作成できます

local m_links_templates = require("モジュール:links/templates")
local com = require("モジュール:he-common")

local export = {}

function export.term(frame)
	local args = {}

	for key, val in pairs(frame:getParent().args) do
		args[key] = val
	end

	if args["wv"] == "" then args["wv"] = nil end
	if args["dwv"] == "" then args["dwv"] = nil end

	if args[2] == nil or args[2] == "" then
		local form, formwv, formdwv = com.process_wv_triad(args[1] or "", args["wv"], args["dwv"])
		args[1] = form or ""
		if formdwv then
			args[2] = (formwv or form) .. " \\ " .. formdwv
		else
			args[2] = (formwv or form)
		end
	end

	args["wv"] = nil
	args["dwv"] = nil

	-- table.insert(args, 1, "he")
	-- shift manually to avoid strange bugs:
	args[4] = args[3]
	args[3] = args[2]
	args[2] = args[1]
	args[1] = "he"

	-- Passthrough arguments after modification
	local frame2 = frame:newChild{title = frame:getParent():getTitle(), args = args}:newChild{title = frame:getTitle(), args = frame.args}

	return m_links_templates.l_term_t(frame2)
end

return export