コンテンツにスキップ

モジュール:xsr-headword

出典: フリー多機能辞典『ウィクショナリー日本語版(Wiktionary)』

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

local export = {}
local pos_functions = {}
local links = require('モジュール:links')
local labels = require('モジュール:labels')
local m_scripts = require("モジュール:scripts")

local lang = require('モジュール:languages').getByCode('xsr')
local PAGENAME = mw.loadData("モジュール:headword/data").pagename
local current_script = lang:findBestScript(PAGENAME)

local Deva_Tibt_translit = require('モジュール:Deva-Tibt-translit')
local Tibt_Deva_translit = require('モジュール:Tibt-Deva-translit')
local function track(page)
	require("モジュール:debug").track("xsr-headword/" .. page)
end
function export.show(frame)
	local args = require('モジュール:parameters').process(frame:getParent().args,{
		['head'] = {},
        ["tr"] = {list = true, allow_holes = true},
	})
	local poscat = frame.args[1] or error('品詞が指定されていません。引数1をモジュールの呼び出しに渡して下さい。')
	
	local data = {lang = lang, sc = current_script, pos_category = poscat, sccat = true, categories = {}, heads = {args['head'] or PAGENAME}, genders = {}, translits = args["tr"],  inflections = {}}
	
	if #data.translits > 0 then
		track("manual-translit/" .. poscat)
	end
	if current_script:getCode() == 'Deva' then
		table.insert(data.inflections, {label = 'チベット文字表記', Deva_Tibt_translit.tr(head or PAGENAME, lang, m_scripts.getByCode('Deva'))})
	end
	if current_script:getCode() == 'Tibt' then
		table.insert(data.inflections, {label = 'デーヴァナーガリー文字表記', Tibt_Deva_translit.tr(head or PAGENAME, lang, m_scripts.getByCode('Tibt'))})
	end
	return require('Module:headword').full_headword(data)
end

return export