跳转到内容

模块讨论:CGroupViewer

页面内容不支持其他语言。
添加话题
维基百科,自由的百科全书
Jimmy-bot在话题“可否不对Item('与', '之间的内容转换繁简?”中的最新留言:2个月前


编辑请求 2020-01-06

[编辑]

请求已拒绝

把函数main改成这样:

function z.main( frame )
	local name = frame.args[1]
	if not name or name == '' then
		return ''
	end
	local data = require( 'Module:CGroup/' .. name )
	if type( data ) ~= 'table' or not data.name or data.name == '' then
		return error.error{ '指定-{zh-hans:模块;zh-hant:模組}-“' .. name .. '”不是有效的转换组' }
	end
	if data.name ~= name then
		return frame:expandTemplate{ title = 'Template:CGroup redirect', args = { 'Module:CGroup/' .. data.name } }
	end
	local text = '<strong>-{H|zh-hans:模块;zh-hant:模組}-以下是[[Wikipedia:字詞轉換處理/公共轉換組|公共转换组]]“' .. data.description .. '”。</strong>\n\n'
	for i, v in ipairs( data.content ) do
		if v.type == 'text' then
			text = text .. makeText( frame, v )
		elseif v.type == 'item' then
			text = text .. makeItem( frame, v )
		end
	end
	text = text .. '[[Category:公共轉換組模板|' .. name .. ']][[Category:公共转换组模块|' .. name .. ']]'
	return text
end

-- Sunny00217 2020年1月6日 (一) 15:21 (UTC)回复

未完成,尝试修改后部分页面出现以下错误:“Lua错误:not enough memory。”。--Xiplus#Talk 2020年1月6日 (一) 23:01 (UTC)回复

那如果改成这样呢:

function z.main( frame )
	local name = frame.args[1]
	if not name or name == '' then
		return ''
	end
	local data = require( 'Module:CGroup/' .. name )
	if type( data ) ~= 'table' or not data.name or data.name == '' then
		return error.error{ '指定-{zh-hans:模块;zh-hant:模組}-“' .. name .. '”不是有效的转换组' }
	end
	if data.name ~= name then
		return frame:expandTemplate{ title = 'Template:CGroup redirect', args = { 'Module:CGroup/' .. data.name } }
	end
	local pieces = { '-{H|zh-hans:模块;zh-hant:模組}-<strong>以下是[[Wikipedia:字詞轉換處理/公共轉換組|公共转换组]]“' .. data.description .. '”。</strong>\n\n' }
	for i, v in ipairs( data.content ) do
		if v.type == 'text' then
			table.insert( pieces, makeText( frame, v ) )
		elseif v.type == 'item' then
			table.insert( pieces, makeItem( frame, v ) )
		end
	end
	table.insert( pieces, '[[Category:公共轉換組模板|' .. name .. ']][[Category:公共转换组模块|' .. name .. ']]' )
	return table.concat( pieces )
end

-- Sunny00217 2020年1月7日 (二) 13:42 (UTC)回复


编辑请求 2021-03-13

[编辑]

请求已处理--Xiplus#Talk 2021年3月23日 (二) 02:18 (UTC)回复

加入Bot use warning。--Xiplus#Talk 2021年3月13日 (六) 02:24 (UTC)回复

可否不对Item('与', '之间的内容转换繁简?

[编辑]

目前仍对公共转换组Item('', '{ type = 'item', original = '', rule = '等之间的内容在预览/显示效果转换繁简,日韩等汉字文化圈事物原名亦被转换,以致部分人士在其中插入-{}-阻止繁简转换。隔断字符既阻碍搜查原名进而引致编修费时甚或不慎重复设置转换规则,又导致去除重复转换规则的机器人无法解析而妨碍去重作业。由于以上种种弊端,加之此部分转换繁简毫无价值,提议此部分不再转换繁简。--— Gohan 2025年1月25日 (六) 03:29 (UTC)回复

@神秘悟饭我无法理解你在讲什么,NoteTA解析时根本没有把原文插入转换规则里--SunAfterRain 2025年1月27日 (一) 15:41 (UTC)回复
喔,看懂了,改过来了--SunAfterRain 2025年1月27日 (一) 15:48 (UTC)回复
极好!谢谢!但上述未提及的CItem、CItemLan语句在预览处似乎依然转换。--— Gohan 2025年1月28日 (二) 07:08 (UTC)回复