遗精什么意思| qq2g在线是什么意思| 宫颈锥切术是什么意思| 鹰击长空是什么意思| 男人精子少吃什么药| 釜底抽薪什么意思| 秋季养胃吃什么好| 孕妇吃冰的东西对胎儿有什么影响| 多管闲事是什么意思| 水母是什么| 呕吐发烧是什么原因| 清点是什么意思| 淡水鱼什么鱼最好吃| 伐木累是什么意思| 腹泻期间宜吃什么食物| 海豹吃什么| mac是什么| 骁字五行属什么| 什么是遴选| 健身前吃什么比较好| 后羿是什么生肖| 纲是什么意思| 问候是什么意思| 梦见抢银行是什么意思| 为什么怀不上孩子| 荞麦茶有什么功效| 现在有什么赚钱的路子| 胃有火吃什么药| 柠檬和什么一起泡减肥| 都市丽人什么意思| 补气是什么意思| 文静是什么意思| abo是什么| 息肉和囊肿有什么区别| 失信名单有什么影响| 肾炎什么症状| 道是什么| 细菌性结膜炎用什么药| 扁桃体肿大吃什么药好| mono是什么意思| 腋下属于什么科| 菩提子是什么材质| 阴唇为什么会长痘痘| 宫颈萎缩意味着什么| 颈椎病头晕吃什么药| 4岁小孩流鼻血是什么原因| ph值是什么意思| 吃什么能去湿气| 什么样的乌云| 散步有什么好处| 吃什么水果减肥最快| 艾迪生病是什么病| 碉堡是什么意思啊| 公务员什么时候退休| 水印是什么| 哺乳期上火了吃什么降火最快| 肌肉溶解是什么意思| 市政协副主席是什么级别| 什么时间立秋| 脸部下垂什么方法提升效果好| 什么叫肿瘤| 姜枣茶什么季节喝最好| 缺铁性贫血严重会导致什么后果| 为什么眼睛老是痒| 三拜九叩是什么意思| 红豆相思是什么动物| 尘螨是什么东西| 一夜白头是什么原因| 长期腹泻是什么病| 脂肪肝能吃什么水果| 曹洪是曹操的什么人| 脾肾两虚吃什么中成药最好| 宝宝干咳嗽是什么原因| 淋是什么意思| 三尖瓣少量反流是什么意思| 狗打针打什么部位| 老打瞌睡犯困是什么原因| 什么玉最值钱| 双向情感障碍是什么| 沙弗莱是什么宝石| 冷喷机喷脸有什么好处| 胯疼是什么原因| 落花生为什么叫落花生| 1108是什么星座| 肌红蛋白偏低说明什么| 高血压吃什么菜| 精液是什么味道的| 为什么左眼皮一直跳| 脸上脂溢性皮炎用什么药| 什么水果贵| 来月经同房有什么影响| 开宠物医院需要什么条件| 取决于你是什么意思| 梦见自己爬山是什么意思| 菊花和什么一起泡最好| 梦见自己化妆是什么意思| 豆浆不能和什么一起吃| 刮痧红色说明什么原因| 胰腺炎挂什么科| 吃什么有助于排便| 力争是什么意思| 蜜蜂的尾巴有什么作用| 椰子煲鸡汤放什么材料| 银花指什么生肖| 烧仙草粉是什么做的| havva是什么牌子| Fine什么意思中文| 茯苓是什么| 虚病是什么意思| 考试前不能吃什么| 令堂是什么意思| 刺身是什么鱼| 明年是什么年啊| 铜绿是什么| 尿路感染吃什么药| 鸟屎掉头上有什么预兆| 补充电解质是什么意思| 天打五雷轰是什么意思| 支气管炎吃什么| 梦见和婆婆吵架是什么意思| 好文采是什么意思| 宫内暗区是什么意思| 1884年属什么生肖| 滴水不漏是什么生肖| 先天性心脏病是什么原因造成的| 捡到狗狗代表什么预兆| 什么是溶血性疾病| 梦见棺材是什么征兆| 大年初一是什么生肖| 西米是什么字| 狼狈是什么动物| 景泰蓝是什么地方的特种工艺| 黑鱼吃什么食物| 生吃大蒜有什么好处| 阴虚吃什么好| 的确什么意思| 日月星辰是什么意思| 经常梦遗是什么原因| 后天是什么日子| 不二人选是什么意思| 小便发黄什么原因| 水洗标是什么| 眉下有痣代表什么| 大腿外侧疼痛是什么原因| 睡不着吃什么药| 65年出生属什么| 三个毛念什么| 夫妻是什么意思| 砥砺什么意思| 肝囊肿挂什么科| 感冒吃什么消炎药| 劫财代表什么| 蛇鼠一窝指什么生肖| 鸡内金是什么东西| 荨麻疹能吃什么| 什么东西最补心脏| 春秋是什么时期| 什么是通勤| 丧偶是什么意思| 整天犯困没精神想睡觉是什么原因| 为什么会生化| 献血对身体有什么好处| 玉竹是什么| 血凝是什么意思| 三联律是什么意思| 十月23日是什么星座| 月光像什么| 罗贯中是什么朝代的| 118代表什么意思| 仰卧起坐是什么现象| 玄关挂什么装饰画好| 白带是什么东西| 苍耳是什么东西| 辅助什么意思| 情绪高涨是什么意思| 花指什么生肖| 谪仙是什么意思| 缺失是什么意思| 阴离子是什么| 飒的意思是什么| 养胃吃什么食物最好| 三点水翟读什么| 好样的什么意思| 态度是什么| 热痱子长什么样| acer是什么牌子| 氟哌酸是什么药| 子宫破裂有什么征兆| he是什么气体| 小孩子坐飞机需要什么证件| 脾胃虚弱吃什么药| 肾积水是什么原因引起的| 湿热吃什么| 前途是什么意思| 地雷是什么意思| 付梓什么意思| 什么牙膏好用| 老人头晕挂什么科| 鼻子出汗是什么原因| 白萝卜煮水喝有什么功效和作用| 心热是什么原因造成的| 空调长时间不用再开注意什么| 6月26什么星座| 解表散热什么意思| 胎儿什么时候入盆| 十一月份是什么星座| 小儿感冒吃什么药| 什么叫做光合作用| 钾在人体中起什么作用| 斑斓什么意思| 尿酸高可以吃什么肉| 尿隐血阴性是什么意思| 下午六点多是什么时辰| 番茄是什么| 鸭胗是什么器官| 尿道口灼热感吃什么药最快| 减肥吃什么水果好| 厌食症吃什么药| 爱到什么时候| 地主之谊是什么意思| 陌上花开可缓缓归矣什么意思| 内在美是什么意思| 蛇生肖和什么生肖相配| 属鼠和什么属相最配| 什么病会通过唾液传播| 人流是什么| 世界上最大的东西是什么| 牙齿发麻是什么原因| 狗血是什么意思| 过是什么结构| 贡菊泡水喝有什么功效| 被什么虫子咬了会刺痛| 有骨气是什么意思| 审时度势是什么意思| 饭撒是什么意思| 猴与什么属相相配最好| 宝宝出急疹要注意什么| 逆天改命是什么意思| 花痴是什么意思| 教唆什么意思| 糖类抗原是检查什么的| 吕布为什么要杀董卓| 总胆红素是什么| id锁是什么| 麸炒是什么意思| 黑曼巴是什么意思| 月经失调是什么原因引起的| 外阴瘙痒是什么情况| sherpa是什么面料| 八字缺什么怎么算| 堂食是什么意思| 绿色大便是什么原因| 楼房风水主要看什么| 算理是什么意思| 心重是什么意思| 胃炎吃什么水果| 家里狗死了预示着什么| 女人喝甘草水有什么好处| 失眠吃什么中药调理效果快| 为什么会感冒| 喝茶喝多了有什么坏处| 胰腺炎的症状是什么| kt是什么意思| r是什么牌子衣服| 百度Jump to content

人民日报看福建--福建频道--人民网

Permanently protected module
From Wikipedia, the free encyclopedia

--------------------------------------------------------------------------------
--                           Module:Hatnote list                              --
--                                                                            --
-- This module produces and formats lists for use in hatnotes. In particular, --
-- it implements the for-see list, i.e. lists of "For X, see Y" statements,   --
-- as used in {{about}}, {{redirect}}, and their variants. Also introduced    --
-- are andList & orList helpers for formatting lists with those conjunctions. --
--------------------------------------------------------------------------------

local mArguments --initialize lazily
local mFormatLink = require('Module:Format link')
local mHatnote = require('Module:Hatnote')
local libraryUtil = require('libraryUtil')
local checkType = libraryUtil.checkType
local p = {}

--------------------------------------------------------------------------------
-- List stringification helper functions
--
-- These functions are used for stringifying lists, usually page lists inside
-- the "Y" portion of "For X, see Y" for-see items.
--------------------------------------------------------------------------------

--default options table used across the list stringification functions
local stringifyListDefaultOptions = {
	conjunction = "and",
	separator = ",",
	altSeparator = ";",
	space = " ",
	formatted = false
}

--Searches display text only
local function searchDisp(haystack, needle)
	return string.find(
		string.sub(haystack, (string.find(haystack, '|') or 0) + 1), needle
	)
end

-- Stringifies a list generically; probably shouldn't be used directly
local function stringifyList(list, options)
	-- Type-checks, defaults, and a shortcut
	checkType("stringifyList", 1, list, "table")
	if #list == 0 then return nil end
	checkType("stringifyList", 2, options, "table", true)
	options = options or {}
	for k, v in pairs(stringifyListDefaultOptions) do
		if options[k] == nil then options[k] = v end
	end
	local s = options.space
	-- Format the list if requested
	if options.formatted then
		list = mFormatLink.formatPages(
			{categorizeMissing = mHatnote.missingTargetCat}, list
		)
	end
	-- Set the separator; if any item contains it, use the alternate separator
	local separator = options.separator
	for k, v in pairs(list) do
		if searchDisp(v, separator) then
			separator = options.altSeparator
			break
		end
	end
	-- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
	local conjunction = s .. options.conjunction .. s
	if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
		conjunction = separator .. conjunction
	end
	-- Return the formatted string
	return mw.text.listToText(list, separator .. s, conjunction)
end

--DRY function
function p.conjList (conj, list, fmt)
	return stringifyList(list, {conjunction = conj, formatted = fmt})
end

-- Stringifies lists with "and" or "or"
function p.andList (...) return p.conjList("and", ...) end
function p.orList (...) return p.conjList("or", ...) end

--------------------------------------------------------------------------------
-- For see
--
-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
-- {{about}} and {{redirect}} templates and their variants.
--------------------------------------------------------------------------------

--default options table used across the forSee family of functions
local forSeeDefaultOptions = {
	andKeyword = 'and',
	title = mw.title.getCurrentTitle().text,
	otherText = 'other uses',
	forSeeForm = 'For %s, see %s.',
}

--Collapses duplicate punctuation at end of string, ignoring italics and links
local function punctuationCollapse (text)
 	return text:match("[.?!]('?)%1(%]?)%2%.$") and text:sub(1, -2) or text
end

-- Structures arguments into a table for stringification, & options
function p.forSeeArgsToTable (args, from, options)
	-- Type-checks and defaults
	checkType("forSeeArgsToTable", 1, args, 'table')
	checkType("forSeeArgsToTable", 2, from, 'number', true)
	from = from or 1
	checkType("forSeeArgsToTable", 3, options, 'table', true)
	options = options or {}
	for k, v in pairs(forSeeDefaultOptions) do
		if options[k] == nil then options[k] = v end
	end
	-- maxArg's gotten manually because getArgs() and table.maxn aren't friends
	local maxArg = 0
	for k, v in pairs(args) do
		if type(k) == 'number' and k > maxArg then maxArg = k end
	end
	-- Structure the data out from the parameter list:
	-- * forTable is the wrapper table, with forRow rows
	-- * Rows are tables of a "use" string & a "pages" table of pagename strings
	-- * Blanks are left empty for defaulting elsewhere, but can terminate list
	local forTable = {}
	local i = from
	local terminated = false
	-- If there is extra text, and no arguments are given, give nil value
	-- to not produce default of "For other uses, see foo (disambiguation)"
	if options.extratext and i > maxArg then return nil end
	-- Loop to generate rows
	repeat
		-- New empty row
		local forRow = {}
		-- On blank use, assume list's ended & break at end of this loop
		forRow.use = args[i]
		if not args[i] then terminated = true end
		-- New empty list of pages
		forRow.pages = {}
		-- Insert first pages item if present
		table.insert(forRow.pages, args[i + 1])
		-- If the param after next is "and", do inner loop to collect params
		-- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
		while args[i + 2] == options.andKeyword do
			if args[i + 3] then
				table.insert(forRow.pages, args[i + 3])
			end
			-- Increment to next "and"
			i = i + 2
		end
		-- Increment to next use
		i = i + 2
		-- Append the row
		table.insert(forTable, forRow)
	until terminated or i > maxArg

	return forTable
end

-- Stringifies a table as formatted by forSeeArgsToTable
function p.forSeeTableToString (forSeeTable, options)
	-- Type-checks and defaults
	checkType("forSeeTableToString", 1, forSeeTable, "table", true)
	checkType("forSeeTableToString", 2, options, "table", true)
	options = options or {}
	for k, v in pairs(forSeeDefaultOptions) do
		if options[k] == nil then options[k] = v end
	end
	-- Stringify each for-see item into a list
	local strList = {}
	if forSeeTable then
		for k, v in pairs(forSeeTable) do
			local useStr = v.use or options.otherText
			local pagesStr =
				p.andList(v.pages, true) or
				mFormatLink._formatLink{
					categorizeMissing = mHatnote.missingTargetCat,
					link = mHatnote.disambiguate(options.title)
				}
			local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
			forSeeStr = punctuationCollapse(forSeeStr)
			table.insert(strList, forSeeStr)
		end
	end
	if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
	-- Return the concatenated list
	return table.concat(strList, ' ')
end

-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
-- but not blank/whitespace values. Ignores named args and args < "from".
function p._forSee (args, from, options)
	local forSeeTable = p.forSeeArgsToTable(args, from, options)
	return p.forSeeTableToString(forSeeTable, options)
end

-- As _forSee, but uses the frame.
function p.forSee (frame, from, options)
	mArguments = require('Module:Arguments')
	return p._forSee(mArguments.getArgs(frame), from, options)
end

return p
玉女心经是什么意思 隽读什么 肝内小囊肿是什么意思 什么是pv 凹儿念什么
玻璃是什么垃圾 皇后是什么意思 脚抽筋是什么原因 沅字五行属什么 腔隙性脑梗吃什么药
手柄是什么意思 电动车是什么电池 脚软没力气是什么原因引起的 卵巢畸胎瘤是什么病 桃子不能和什么水果一起吃
水奶和奶粉什么区别 什么是制片人 动脉圆锥是什么意思 疱疹长什么样子图片 什么是桃花劫
六月十二日是什么日子hcv8jop1ns3r.cn 么么哒什么意思hcv9jop7ns2r.cn 一杆进洞叫什么球hcv8jop3ns1r.cn 生化了是什么意思hcv8jop2ns6r.cn 眼睛肿了用什么药hcv8jop0ns0r.cn
天蝎配什么星座hcv9jop8ns0r.cn 什么是冰丝面料hcv8jop4ns8r.cn 珅是什么意思hcv8jop5ns0r.cn 有什么无什么的成语hcv8jop7ns1r.cn hmo是什么hcv7jop6ns8r.cn
吃什么长头发又密又多hcv8jop4ns3r.cn 牛的尾巴有什么作用hcv8jop9ns6r.cn 秒男是什么意思clwhiglsz.com 积液是什么东西hcv9jop2ns5r.cn 分明的意思是什么hcv8jop9ns8r.cn
吐白沫是什么原因hcv8jop5ns9r.cn 84年属什么生肖hcv8jop9ns6r.cn 蛇信子是什么hcv8jop6ns0r.cn 戴玉对身体有什么好处hcv8jop1ns6r.cn 天加一笔变成什么字hcv9jop5ns4r.cn
百度