跳转到内容

模組:CGroupViewer

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由Liangent留言 | 贡献2014年6月18日 (三) 11:21 建立内容为“local z = {} local error = require( 'Module:Error' ) function z.main( frame ) local name = frame.args[1] local data = require( 'Module:CGroup/' ....”的新页面)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

local z = {}
local error = require( 'Module:Error' )

function z.main( frame )
	local name = frame.args[1]
	local data = require( 'Module:CGroup/' .. name )
	local pieces = { '以下是[[Wikipedia:字詞轉換處理/公共轉換組|公共转换组]]“' .. data.description .. '”。' }
	for i, v in ipairs( data.content ) do
		if v.type == 'text' then
			table.insert( pieces, v.text )
		elseif v.type == 'item' then
			local text = ''
			if v.original then
				text = text .. '原文:' .. v.original
			end
			text = text .. '-{D|' .. v.rule .. '}-' .. '\n'
			table.insert( pieces, text )
		end
	end
	return table.concat( pieces )
end

return z