モジュール:nb-noun-common-irreg

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

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

local export = {}

local lang = require("モジュール:languages").getByCode("nb")
 
function export.main(frame)
	args = frame:getParent().args
	PAGENAME = mw.title.getCurrentTitle().text
	length = mw.ustring.len(PAGENAME)
	
	t5 = mw.ustring.sub(PAGENAME, length-4, length)
	t4 = mw.ustring.sub(PAGENAME, length-3, length)
	t3 = mw.ustring.sub(PAGENAME, length-2, length)
	t2 = mw.ustring.sub(PAGENAME, length-1, length)
			 
	if t4 == 'mann' then
		p1 = mw.ustring.sub(PAGENAME, 1, length-4)
		gender = 'm'
		definite_singular = p1 .. 'mannen'
		indefinite_plural = p1 .. 'menn'
		definite_plural = p1 .. 'mennene'		
	else
		return "<span style=\"color:Red\">'''名詞''" .. PAGENAME .. "'' はこのテンプレートでサポートされていません。'''</span>代わりに{{[[Template:nb-noun-irreg|nb-noun-irreg]]|<gender>|<definite singular>|etc.}}を使用して下さい。" 
	end

	local inflections = {
		{label = '限定単数', definite_singular},
		{label ='非限定複数', indefinite_plural}, 
		{label = '限定複数', definite_plural} }
	
	return require("モジュール:headword").full_headword{
		lang = lang,
		genders = {gender},
		inflections = inflections,
		categories = {lang:getCanonicalName() .. " 名詞"},
	}
end

return export