脸上过敏用什么药膏| 裹小脚是什么时候开始的| 小腹变大是什么原因| mica是什么意思| 什么最重要| 扬长而去是什么意思| 吃什么补气虚最快最好| 痛风能吃什么菜谱大全| 肾功能不好有什么症状| 暨怎么读什么意思| 蛇最怕什么药| dsa什么意思| 什么样的你| hpv检查挂什么科| 此言念什么| 甘油三酯什么意思| 肠胃炎吃什么| 喝茶叶茶有什么好处和坏处| 胆固醇和血脂有什么区别| apk是什么格式| 功夫2什么时候上映| 置换什么意思| 吃什么东西| 毕业送什么礼物给老师| 双飞什么意思| 做梦梦到乌龟是什么预兆| 腿疼吃什么药| 脚没力气是什么原因| 果胶是什么| 三聚磷酸钠是什么| 四维空间是什么| 什么时候断奶最合适| 18k金是什么| 什么面不能吃| 狗上皮过敏是什么意思| 为什么左手会发麻| 众矢之的是什么意思| 梅毒螺旋体抗体阳性是什么意思| 专业职称是什么| 爷俩是什么意思| 外强中干是什么意思| 血糖高可以吃什么| 让您费心了是什么意思| 梦见大火是什么意思| 三个水念什么| 洗衣机不排水是什么原因| viki什么意思| 鸡腿炖什么好吃| pink是什么颜色| 肾阴虚是什么原因造成的| cip是什么| 血清高是什么原因| 什么样的歌声| 玫瑰和月季有什么区别| 大同有什么好吃的| 青鱼和草鱼有什么区别| 嘴唇淡紫色是什么原因| 非农业户口是什么意思| 交警支队长是什么级别| 黄瓜有什么营养价值| 除了肠镜还有什么方法检查肠道| 定海神针什么意思| 女人大把掉头发是什么原因| 蚊子怕什么植物| 氯雷他定片是治什么的| 8月11号是什么星座| 梦见很多棺材是什么征兆| 试孕纸什么时候测最准| 彩超无回声是什么意思| 什么什么一什么| 小李子为什么叫小李子| 日本桑是什么意思| 结晶高是什么原因| 九十岁老人称什么| 红米是什么米| 腰两边疼是什么原因| 脚为什么脱皮| 零星是什么意思| 怀孕了不想要最好的办法是什么| 屁多又臭是什么原因| 二线用药是什么意思| 雾霾蓝配什么颜色好看| cd是什么| 宽宏大度是什么生肖| 图例是什么| 政协主席是干什么的| 孕妇吃什么水果对胎儿好| 脉搏高是什么原因| 承五行属什么| 为什么喉咙经常痛| 挥霍是什么意思| 免疫治疗是什么意思| 怀孕从什么时候开始算起| 大林木命适合做什么行业| 为什么心慌| 儿保科主要是检查什么| 吃什么避孕药可以推迟月经| 一什么湖水| 深海鱼油的作用是什么| 无中生有是什么生肖| 全身而退是什么意思| 你的脚步流浪在天涯是什么歌曲| 其可以组什么词| 什么人不能吃海带| ad是什么的缩写| 官能是什么意思| 懿代表什么意思| 淋巴门结构可见是什么意思| 胸疼是什么原因| 正骨挂什么科| 84属什么生肖| 日龙包什么意思| 血糖高吃什么| 甲亢看什么科| 7月7是什么节日| 风湿病挂什么科| 肉桂跟桂皮有什么区别| camel是什么牌子| 抽烟打嗝是什么情况| 阴茎皮开裂是什么原因| 艮宫代表什么| 一月份什么星座| 微商是什么意思| 二甲医院是什么级别| ip指的是什么| 臁疮是什么病| 单纯疱疹病毒是什么病| efw是胎儿的什么意思| 什么叫原发性高血压| 花椒是什么| 什么是玉石| 酸豆角炒什么好吃| 麦粒肿吃什么药| 撒西不理是什么意思| 脂肪滴是什么意思| 胎盘是什么| 一呼吸胸口疼是什么原因| 摩羯座跟什么星座最配| 孩子发烧呕吐是什么原因| 喉咙发炎不能吃什么食物| 低血压吃什么补得最快| 儿童内热吃什么去内热| 羊的五行属什么| 偏瘫是什么意思| 抑郁症吃什么药| 红颜知己是什么关系| 维生素b2治什么病| 年轻人血压高是什么原因引起的| 经常性头疼是什么原因| 468是什么意思| 维生素e和维生素c一起吃有什么效果| 空气湿度是什么意思| 梦见建房子是什么预兆| 6月份是什么星座的| 腰椎疼挂什么科| 什么时候开放二胎| 哭什么| 老年痴呆挂什么科| 为什么蚊子咬了会起包| 林可霉素主治什么病| ab阳性血型是什么血型| 免职和撤职有什么区别| 岫岩玉是什么玉| 98年属什么的| 什么的窗户| 大小便失禁是什么原因| 温水煮青蛙是什么意思| 公斤和斤有什么区别| 八月十八号是什么星座| 10月17是什么星座| 中药为什么要热着喝| 尿血是什么病| cov是什么意思| 大千是什么意思| 多西他赛是什么药| 独生子女证办理需要什么材料| 愤青什么意思| 岳飞属什么生肖| 戌怎么读音是什么| 胆没了对身体有什么影响| 补肾虚吃什么药最好| 冬练三九夏练三伏是什么意思| 农历正月初一是什么节日| 孩子打呼噜是什么原因| 缩量是什么意思| 潜意识是什么| 什么生木| 王字旁和什么有关| 蜜蜂糖冲开水有什么好处| 一什么斑点| 什么牌子的氨基酸洗面奶好| 眉毛上方有痣代表什么| 脑梗需要注意什么| 乳腺病是什么意思| 退休是什么意思| 梦见好多水果是什么预兆| 来大姨妈能喝什么饮料| 牙齿经常出血是什么原因| 月经期间可以喝什么汤比较好| 木有什么意思| 皮肤起小水泡很痒是什么原因| 想吃肉是身体缺什么| 磨玻璃影是什么意思| 五台山是什么菩萨的道场| 伤口用什么消毒| 童瑶为什么要告黄定宇| ivd是什么意思| 脸上长闭口是什么原因导致的| 女性吃什么降低雄激素| 3个火读什么| 冰枕对人有什么危害吗| 直博是什么意思| 世界上最贵的东西是什么| d代表什么单位| 氟哌酸又叫什么| 肾上腺素高会导致什么| 结婚需要准备什么| 植物园里有什么| 淋巴发炎挂什么科| 吃什么容易排便| cognac是什么酒| 疝气是什么| 什么是捞女| 纣王姓什么| 宝典是什么意思| 不约什么什么| 龙骨为什么比排骨便宜| 男人吃什么大补| 亚甲蓝注射起什么作用| 查岗是什么意思| 糖类抗原199是什么意思| 6.1号是什么星座| 胃疼吃什么食物| 热得什么| 为什么突然长癣了| 吃了小龙虾不能吃什么| 丙申五行属什么| 太阳里面有什么| 头皮屑大块是什么原因| 皂基是什么| 做梦梦到蜘蛛是什么意思| 非洲人一日三餐吃什么| 鸡蛋和面粉可以做什么好吃的| 紧急避孕药什么时候吃有效| 男狗配什么属相最好| 6月25日是什么日子| 氮肥是什么肥| 全距是什么意思| 吃维生素c有什么好处| 太平猴魁属于什么茶| 麦粒肿滴什么眼药水| 什么油适合油炸| 什么叫压力| 尿酸低有什么危害| 耵聍是什么| europe是什么意思| 督察是什么意思| 黄豆煲汤搭配什么最好| 什么样的土豆不能吃| 你想什么| 头发长的慢是什么原因| 做梦剪头发是什么意思| 无脑儿是什么意思| 小腿肚子抽筋是什么原因| 百度Jump to content

专家:赖清德再出“台独”狂言意欲何为?安峰山赖清德蔡英文

Permanently protected module
From Wikipedia, the free encyclopedia

require('strict')
local m_data = mw.loadData("Module:Wikt-lang/data")
local langData = m_data.languages or m_data

local p = {}

local function ifNotEmpty(value)
	if value == "" then
		return nil
	else
		return value
	end
end

local function makeEntryName(word, languageCode)
	local data = langData[languageCode]
	local ugsub = mw.ustring.gsub
	word = tostring(word)
	if word == nil then
		error("The function makeEntryName requires a string argument")
	elseif word == "" then
		return ""
	else
		-- Remove bold and italics, so that words that contain bolding or emphasis can be linked without piping.
		word = word:gsub("\'\'\'", "")
		word = word:gsub("\'\'", "")
		if data == nil then
			return word
		else
			local replacements = data and data["replacements"]
			if replacements == nil then
				return word
			else
				-- Decompose so that the diacritics of characters such
				-- as á can be removed in one go.
				-- No need to compose at the end, because the MediaWiki software
				-- will handle that.
				if replacements.decompose then
					word = mw.ustring.toNFD(word)
					for i, from in ipairs(replacements.from) do
						word = ugsub(
							word,
							from,
							replacements.to and replacements.to[i] or "")
					end
				else
					for regex, replacement in pairs(replacements) do
						word = ugsub(word, regex, replacement)
					end
				end
				return word
			end
		end
	end
end

local function fixScriptCode(firstLetter, threeLetters)
	return string.upper(firstLetter) .. string.lower(threeLetters)
end

local function getCodes(codes)
	local languageCode, scriptCode, invalidCode
	local errorText
	if codes == nil or codes == "" then
		errorText = 'no language or script code provided'
	elseif codes:find("^%a%a%a?$") or codes:find("^%a%a%a?%-%a%a%a%a$") then
		-- A three- or two-letter lowercase sequence at beginning of first parameter
		languageCode =
			codes:find("^%a%a%a?") and (
				codes:match("^(%l%l%l?)")
				or codes:match("^(%a%a%a?)")
					:gsub("(%a%a%a?)", string.lower, 1)
			)
		-- One uppercase and three lowercase letters at the end of the first parameter
		scriptCode =
			codes:find("%a%a%a%a$") and (
				codes:match("(%u%l%l%l)$")
				or gsub(
					codes:match("(%a%a%a%a)$"),
					"(%a)(%a%a%a)",
					fixScriptCode,
					1
				)
			)
	elseif codes:find("^%a%a%a?%-%a%a%a?$")
	or codes:find("^%a%a%a%-%a%a%a%-%a%a%a$") then
		languageCode = codes
	
	-- Private-use subtag: x followed by one or more sequences of 1-8 lowercase
	-- letters separated by hyphens. This only allows for one sequence, as it is
	-- needed for proto-languages such as ine-x-proto (Proto-Indo-European).
	elseif codes:find("^%a%a%a?%-x%-%a%a?%a?%a?%a?%a?%a?%a?$") then
		languageCode, scriptCode =
			codes:match("^(%a%a%a%-x%-%a%a?%a?%a?%a?%a?%a?%a?)%-?(.*)$")
		if not languageCode then
			errorText = '<code>'..codes..'</code> is not a valid language or script code.'
		elseif scriptCode ~= "" and not scriptCode:find("%a%a%a%a") then
			errorText = '<code>'..scriptCode..'</code> is not a valid script code.'
		else
			scriptCode = scriptCode:gsub(
				"(%a)(%a%a%a)",
				fixScriptCode,
				1
			)
		end
	elseif codes:find("^%a%a%a?") then
		languageCode, invalidCode = codes:match("^(%a%a%a?)%-?(.*)")
		languageCode = string.lower(languageCode)
		errorText = '<code>'..invalidCode..'</code> is not a valid script code.'
	elseif codes:find("%-?%a%a%a%a$") then
		invalidCode, scriptCode = codes:match("(.*)%-?(%a%a%a%a)$")
		scriptCode = gsub(
			scriptCode,
			"(%a)(%a%a%a)",
			fixScriptCode
		)
		errorText = '<code>'..invalidCode..'</code> is not a valid language code.'
	else
		errorText = '<code>'..codes..'</code> is not a valid language or script code.'
	end
	if errorText then
		errorText = ' <span style="font-size: smaller">[' .. errorText .. ']</span>'
	else
		errorText = ""
	end
	languageCode = m_data.redirects[languageCode] or languageCode
	return languageCode, scriptCode, errorText
end

local function tag(text, languageCode, script, italicize)
	local data = langData[languageCode]
	-- Use Wikipedia code if it has been given: for instance,
	-- Proto-Indo-European has the Wiktionary code "ine-pro" but the Wikipedia
	-- code "ine-x-proto".
	languageCode = data and data.Wikipedia_code or languageCode
	if script and script ~= "" then
		languageCode = languageCode .. "-" .. script
	end

	if not text then text = "[text?]" end
	
	local textDirectionMarkers = { "", "", "" }
	if data and data["direction"] == "rtl" then
		textDirectionMarkers = { ' dir="rtl"', '&rlm;', '&lrm;' }
	end
	
	local out = { textDirectionMarkers[2] }
	if italicize then
		table.insert(out, "<i lang=\"" .. languageCode .. "\"" .. textDirectionMarkers[1] .. ">" .. text .. "</i>")
	else
		table.insert(out, "<span lang=\"" .. languageCode .. "\"" .. textDirectionMarkers[1] .. ">" .. text .. "</span>")
	end
	table.insert(out, textDirectionMarkers[3])
	
	return table.concat(out)
end

local function linkToWiktionary(entry, linkText, languageCode)
	local data = langData[languageCode]
	local name
	if languageCode then
		if data and data.name then
			name = data.name
		else
			-- On other languages' wikis, use mw.getContentLanguage():getCode(),
			-- or replace 'en' with that wiki's language code.
			name = mw.language.fetchLanguageName(languageCode, 'en')
			if name == "" then
				error("Name for the language code " .. ("%q"):format(languageCode or nil)
					.. " could not be retrieved with mw.language.fetchLanguageName, "
					.. "so it should be added to [[Module:Wikt-lang/data]]")
			end
		end
		if entry:sub(1, 1) == "*" then
			if name ~= "" then
				entry = "Reconstruction:" .. name .. "/" .. entry:sub(2)
			else
				error("Language name is empty")
			end
		elseif data and data.type == "reconstructed" then
			mw.log("Reconstructed language without asterisk:", languageCode, name, entry)
			local frame = mw.getCurrentFrame()
			-- Track reconstructed entries with no asterisk by transcluding
			-- a nonexistent template. This technique is used in Wiktionary:
			-- see [[wikt:Module:debug]].
			-- [[Special:WhatLinksHere/tracking/wikt-lang/reconstructed with no asterisk]]
			pcall(frame.expandTemplate, frame,
				{ title = 'tracking/wikt-lang/reconstructed with no asterisk' })
			if name ~= "" then
				entry = "Reconstruction:" .. name .. "/" .. entry
			else
				error("Language name is empty")
			end
		elseif data and data.type == "appendix" then
			if name ~= "" then
				entry = "Appendix:" .. name .. "/" .. entry
			else
				error("Language name is empty")
			end
		end
		if entry and linkText then
			return "[[wikt:" .. entry .. "#" .. name .. "|" .. linkText .. "]]"
		else
			error("linkToWiktionary needs a Wiktionary entry or link text, or both")
		end
	else
		return "[[wikt:" .. entry .. "|" .. linkText .. "]]"
	end
end

function p.wiktlang(frame)
	local parent = frame:getParent()
	local args = parent.args[1] and parent.args or frame.args
	
	local codes = args[1] and mw.text.trim(args[1])
	local word1 = ifNotEmpty(args[2])
	local word2 = ifNotEmpty(args[3])
	
	if not args[2] or '' == args[2] then
		return '<span style="color:#d33">[text?] Parameter 2 is required</span>';
	end
	
	local languageCode, scriptCode, errorText = getCodes(codes)
	
	local italics = args.italics or args.i or args.italic
	italics = not (italics == "n" or italics == "-" or italics == "no")
	
	local entry, linkText
	if word2 and word1 then
		entry = makeEntryName(word1, languageCode)
		linkText = word2
	elseif word1 then
		entry = makeEntryName(word1, languageCode)
		linkText = word1
	end

	local italicize = italics and (scriptCode == "Latn" or require("Module:Unicode data").is_Latin(linkText))

	local out
	if languageCode and entry and linkText then
		out = tag(linkToWiktionary(entry, linkText, languageCode), languageCode, scriptCode, italicize)
	elseif entry and linkText then
		out = linkToWiktionary(entry, linkText)
	else
		out = '<span style="font-size: smaller;">[text?]</span>'
	end
	
	if out and errorText then
		return out .. errorText
	else
		return errorText or error("The function wiktlang generated nothing")
	end
end

return p
心脏肿大是什么原因 梦见茄子是什么意思 推拿是什么意思 梅核气吃什么药好得快 出水痘不能吃什么食物
耳后有痣代表什么 火龙果跟什么榨汁好喝 0206是什么星座 无缝衔接什么意思 土崩瓦解是什么意思
小鸡啄米什么意思 食管裂孔疝什么意思 脑供血不足是什么原因引起的 呵呵代表什么意思 腰肌劳损是什么症状
脑血管堵塞是什么症状 咳血是什么病 小便无力是什么原因男 熬夜对心脏有什么影响 芥末黄是什么颜色
吃什么增加免疫力hcv8jop1ns5r.cn 汕头有什么好玩的地方hcv9jop1ns7r.cn 口腔上颚疼是什么原因hcv8jop9ns1r.cn 空鼻症是什么cj623037.com 右手麻木是什么原因引起的jasonfriends.com
双脚麻木是什么病的前兆hcv8jop6ns7r.cn exchange是什么意思hcv7jop9ns4r.cn 什么样的人能镇住凶宅hcv8jop3ns9r.cn 孕妇能喝什么茶hcv8jop4ns5r.cn 冒菜是什么菜hcv9jop4ns9r.cn
大拇指抖动是什么原因引起的yanzhenzixun.com 脚指麻木是什么病先兆hcv8jop0ns7r.cn 九秩是什么意思bjcbxg.com 多是什么结构的字hcv9jop1ns9r.cn 西游记是什么时候写的helloaicloud.com
5年存活率是什么意思hcv8jop7ns1r.cn 失眠吃什么药最有效hcv9jop4ns0r.cn 火钳刘明什么意思hcv9jop3ns2r.cn 结婚长明灯有什么讲究hcv7jop5ns2r.cn 赭是什么颜色hcv8jop1ns7r.cn
百度