秋天有什么花| 为什么阴道会放气| cas号是什么| 牵牛花为什么叫牵牛花| 黑洞是什么东西| 腰间盘膨出是什么意思| 1993年什么命| 一对什么填空| 妇科炎症吃什么药| 石斛什么人不适合吃| 不由自主的摇头是什么病| 酸奶用什么菌发酵| 什么东西养胃| 瑞士用什么货币| 脾大有什么危害| 什么什么的荷花| 冠心病吃什么药最好| 什么是聚酯纤维面料| 米放什么不生虫子| 焦虑抑郁吃什么药| 吉士是什么| saba是什么药| 去医院检查艾滋病挂什么科| 肺与什么相表里| 近水楼台先得月是什么生肖| 梦见找鞋子是什么意思| 4.5是什么星座| 刮痧用什么油刮最好| 男生为什么喜欢摸胸| 什么时候开始胎教| 脸部肿胀是什么原因| 孕妇应该吃什么蔬菜| 什么人容易得脑梗| 靖康耻指的是什么历史事件| 尿臭是什么原因男性| 反将一军什么意思| a4纸能折什么| 释然是什么意思| 脸上长痣是什么原因| 长针眼是什么原因| 常吃海带有什么好处| 请问紫苏叶有什么功效| 癌胚抗原高是什么意思| 什么叫因果| 郁是什么意思| 0.618是什么意思| mi是什么意思| pms是什么| 鸡蛋白是什么| 什么是碳酸饮料| 发晕是什么原因引起的| 什么叫静脉曲张| 腿麻是什么病的前兆吗| 香港奶粉为什么限购| 大便粘马桶吃什么药| 梦见订婚是什么意思| 郭德纲什么学历| 早餐吃什么最好| po是什么的缩写| 货值是什么意思| 卵巢囊肿是什么| 隐是什么意思| 轻微脑震荡有什么表现| 代肝是什么意思| 凉瓜是什么瓜| 睡醒口干口苦是什么原因| 做什么生意最赚钱| 失格是什么意思| 女性尿里带血是什么原因| 减肥期间晚上吃什么| 回民为什么不吃猪肉| 哎一古是什么意思| 下午2点半是什么时辰| 铁皮石斛花有什么作用| 查肝胆胰脾肾挂什么科| 乙肝表面抗体弱阳性是什么意思| 孕妇头疼是什么原因| 白内障有什么症状| 枕头太低了有什么危害| 猫上门为什么不能赶走| 生姜水洗头有什么好处| 肺动脉高压用什么药| 生气发抖是什么原因| 景泰蓝是什么地方的特种工艺| 牙龈肿吃什么药| 河北古代叫什么| 读书破万卷下一句是什么| 脖子疼什么原因| 孕妇吃榴莲对胎儿有什么好处| 早上起床喉咙有痰是什么原因| 小鸭吃什么| 反应性增生是什么意思| 社保缴费基数什么意思| 呼吸道感染一般用什么消炎药| 多才多艺是什么生肖| 婴儿泡奶粉用什么水好| 缺什么补什么| 唐三藏的真名叫什么| 什么情况下吃丹参滴丸| 7号来的月经什么时候是排卵期| 什么是特异性皮炎| 月经不规律是什么原因| 荔枝补什么| 人参什么时候吃最好| 为什么有的女人欲太强| 流是什么意思| 吃什么补维生素D效果最好| 荨麻疹吃什么药最好| 健康查体是什么意思| 吃茄子有什么坏处| 前面有个豹子是什么车| 10.17是什么星座| 弯弯的月儿像什么| 苹果绿是什么颜色| 女人吃黄芪有什么好处| 冬虫夏草为什么叫冬虫夏草| 特需号是什么意思| 三十六计第一计是什么计| 吃梨有什么好处| 乳房痛是什么原因| 61岁属什么生肖| 吃什么水果对胃好| 耵聍是什么东西| 头发不长是什么原因| 为什么会痛经| 中线是什么| 小叶紫檀有什么功效| 什么星空| 女生什么时候最想要| 旧加一笔是什么字| 高密度脂蛋白胆固醇偏高什么意思| 穆赫兰道到底讲的什么| 什么药可以溶解血栓| 尿频尿急吃什么药比较好| 什么是数位板| 土茯苓和什么煲汤最好| 深圳车牌摇号需要什么条件| 心肌是什么意思| 落户什么意思| 集体户口和个人户口有什么区别| 藜麦是什么| h是什么牌子的皮带| pc是什么缩写| 湿疹用什么药好得最快最有效| 心超是检查什么的| 张飞为什么不救关羽| 甲状腺结节有什么感觉| 胆囊炎吃什么中成药| 普拉提是什么| 特点是什么意思| bff是什么意思| 小孩走路迟是什么原因| 古代地龙是什么| 蜻蜓点水是什么行为| 尿素测定是查什么| 一个米一个参念什么| 无字五行属什么| 高血压吃什么药效果好| 碱性磷酸酶是什么| 长命百岁是什么生肖| 肥达氏反应检查什么病| 幼猫能吃什么| 晚上五点是什么时辰| 什么洗面奶好用| 来大姨妈喝酒有什么影响| 国防科技大学毕业是什么军衔| 扫兴什么意思| 康斯坦丁是什么意思| 什么是干眼症| 39是什么意思| 哈密瓜不能和什么一起吃| 七月十日是什么日子| 香港的别称是什么| 产检都检查什么项目| 1980属什么生肖| 腰脱什么症状| 中国第五大发明是什么| 8月27是什么星座| 早餐吃什么| 胃病吃什么药最好根治| 病案首页是什么| 四叶草代表什么意思| 上腹胀是什么原因| 401什么意思| 小手指麻木是什么原因| 梦见盗墓是什么意思| 日语为什么| 什么什么不周| 装什么病能容易开病假| 嘴唇发紫是什么原因引起的| 小孩尿酸高是什么原因| 心电图能检查出什么| 小猪佩奇为什么这么火| 云南雪燕有什么作用| 什么是超话| 嗓子老有痰是什么原因| stella是什么意思| 美甲什么颜色显手白| 聚乙二醇是什么东西| 人乳头瘤病毒是什么| kyocera是什么牌子| 血热吃什么中成药| daks是什么品牌| 肺积水是什么病| 逍遥丸治什么| 九八年属什么生肖| 敏感的反义词是什么| 什么是继发性高血压| 男人下面流脓吃什么药| 薏米和什么一起煮粥最好| 中央电视台台长是什么级别| 心脏供血不足吃什么药好| 飞蚊症用什么药物治疗最好| 7月26是什么星座| 八仙过海指什么生肖| 痢疾是什么症状| 猫五行属什么| 失去抚养权意味着什么| 胃窦隆起是什么意思| 状元是什么官| 什么是日记| 唇炎是什么原因引起的| ct和b超有什么区别| 少许是什么意思| 懿代表什么意思| 海虾不能和什么一起吃| 汗多是什么原因| 虾吃什么| 11月20日什么星座| 吃什么东西能减肥| 阑珊什么意思| 1978年属什么的| bella什么意思| 生物素是什么| 什么的嫩芽| 歼31为什么没消息了| 热伤风感冒吃什么药| 光子嫩肤是什么| 麦克白夫人什么意思| 六月二十九日是什么星座| 梦见缝被子是什么意思| 兔子肉不能和什么一起吃| 眉目的比喻义是什么| 如什么如什么的成语| 大料是什么调料| 女性什么时候绝经| 化生子是什么意思| 软开是什么| 跑完步头疼是为什么| 梦见自己吐血是什么征兆| 狐臭是什么人种的后代| 什么花一年四季都开花| 禁忌症是什么意思| 五行中什么生木| 2024年属什么生肖| 颈椎曲度变直是什么意思| 什么人不能吃西洋参| 枣子什么时候成熟| 腹股沟疝气挂什么科| 灻是什么意思| 胎位roa是什么意思| 怀孕初期需要注意些什么| 胸部ct平扫能检查出什么| 多囊吃什么药| 百度Jump to content

金沙江创投朱啸虎谈VR:你看中的 可能是个假的风口

Permanently protected module
From Wikipedia, the free encyclopedia

-- to enable us to replicate the current functioning of Country extract, we need to deal with:
-- 2 {{<name>}} DONE!
-- 3 [[<name>]] DONE!
-- 4 [[<name>|<junk>]] DONE!
-- 5 [[image:flag of <country>.[svg|gif|png|jpg]|\d+px]] DONE!

local p = {}
local getArgs = require("Module:Arguments").getArgs
local data = mw.loadData("Module:ISO 3166/data/National")

--[[----------C A T S----------]]--												-- Assign error categories
local function cats(cat, args)
	if not (args.nocat and args.nocat == 'true') and mw.title.getCurrentTitle().namespace == 0 then
		if cat == 'nocountry' then
			return '[[Category:Wikipedia page with obscure country]]'
		elseif cat == 'nosubdivision' then
			return '[[Category:Wikipedia articles with obscure subdivision]]'
		end
	end
	return ''
end

--[[----------F I N D N A M E----------]]--										-- Finds the name in the database

local function findname(code,cdata,qry)
	local sqry = p.strip(qry)
	if cdata["name"] and sqry==p.strip(cdata["name"])
		or cdata["isoname"] and sqry==p.strip(cdata["isoname"])
		or not cdata["nocode"] and sqry==code
		or sqry==cdata["alpha3"] or sqry==cdata["numeric"]
		then
		return true
	end
	for _,tname in pairs(cdata["isonames"] or {}) do
		if sqry==p.strip(tname) then
			return true
		end
	end
	for _,tname in pairs(cdata["altnames"] or {}) do
		if sqry==p.strip(tname) then
			return true
		end
	end
	return false
end

--[[----------I S O N A M E----------]]--										-- Find the ISO name of a country/region

local function isoname(data,code,lang)
	if data[code]["isonames"] then
		local name = data[code]["isodisplaynames"] and data[code]["isodisplaynames"][lang]
			 or data[code]["isonames"][lang]
			 or data[code]["isodisplaynames"] and data[code]["isodisplaynames"][data[code]["defaultlang"] or data["defaultlang"]]
			 or data[code]["isonames"][data[code]["defaultlang"] or data["defaultlang"]]
			 or data[code]["isodisplaynames"] and data[code]["isodisplaynames"]["en"]
			 or data[code]["isonames"]["en"]
		if name then return name end
		for _,iname in pairs(data[code]["isonames"]) do return iname end
		return data[code]["isodisplayname"] or data[code]["isoname"]
	else
		return data[code]["isodisplayname"] or data[code]["isoname"]
	end
end

--[[----------S T R I P----------]]--											-- Removes junk from the input

function p.strip(text)
	if not text then return nil end
	
	local accents = {["à"]="A",["á"]="A",["?"]="A",["?"]="A",					-- accent list
		["?"]="A",["?"]="A",["?"]="C",["è"]="E",["é"]="E",
		["ê"]="E",["?"]="E",["ì"]="I",["í"]="I",["?"]="I",
		["?"]="I",["?"]="N",["ò"]="O",["ó"]="O",["?"]="O",
		["?"]="O",["?"]="O",["?"]="O",["ù"]="U",["ú"]="U",
		["?"]="U",["ü"]="U",["Y"]="Y"
	}
	local remove = {"NATION OF","COUNTRY OF","TERRITORY OF",					-- text to be removed list
		"FLAG OF","FLAG","KINGDOM OF","STATE OF"," STATE ",
		"PROVINCE OF","PROVINCE","TERRITORY"
	}
	local patterns = {[".+:"]="",["|.+"]="",["%(.-%)"]="",						-- patterns to follow (order may matter)
		["%..*"]="",["^THE "]="",["%_"]=" ",["%-"]=" ",
		["%d%d?%d?PX"]="",
	}
	
	text = mw.text.decode(text)                                                 -- Decode HTML entities (passed from wikidata?)
	text = mw.text.unstripNoWiki(text)											-- Remove <nowiki> tags
	text = mw.ustring.upper(text)												-- Case insensitivity
	text = mw.ustring.gsub(text,"[à-Y]",accents)								-- Deaccent
	
	for pattern,value in pairs(patterns) do										-- Follow patterns
	text = mw.ustring.gsub(text,pattern,value) 
	end
	
	for _,words in pairs(remove) do												-- Remove unneeded words
	text = mw.ustring.gsub(text,words,"") 
	end
	
	text = mw.ustring.gsub(text,"%W","")										-- Remove non alpha-numeric
	
	return text
	
end

--[[----------P . C A L L S T R I P ---------]]--								-- Calls P.strip but using Module:Arguments

function p.callstrip(frame)
	
	local args = getArgs(frame)
	
	return p.strip(args[1]) or ""

end

--[[----------P . L U A C O D E---------]]--									-- Makes the ISO code of a country

function p.luacode(args)

	local code1 = p.strip(args[1])
	local code2 = p.strip(args[2])

	if args["codetype"]=="3" then args["codetype"]="alpha3" end
	
	local eot = args.error or ""
	
	if (code1 or "") == "" then
		return cats('nocountry', args), '<span style="font-size:100%" class="error">"No parameter for the country given"</span>'
	end
	
	if (code2 or "") == "" then													--3166-1 code
		for alpha2,cdata in pairs(data) do
			if findname(alpha2,cdata,code1) then
				if args["codetype"]=="numeric" or args["codetype"]=="alpha3" then
					return cdata[args["codetype"]]
				else
					return alpha2
				end
			end
		end
		if string.find(args[1] or '',"%-") then
			args[1], args[2] = string.match(args[1] or '',"^([^%-]*)%-(.*)$")
			if args[2] then return p.luacode(args) end
		end
		return cats('nocountry', args)
	else																		--3166-2 code
		for alpha2,cdata in pairs(data) do                                       
			if findname(alpha2,cdata,code1) then
				if mw.ustring.match(alpha2,"GB") then							-- For England, Wales etc.
					alpha2 = "GB"
				end
				local sdata = mw.loadData("Module:ISO 3166/data/"..alpha2)
				local empty = true
				for scode,scdata in pairs(sdata) do
					if type(scdata)=="table" then
						empty = false
						if findname(scode,scdata,code2) then
							return alpha2.."-"..scode
						end
					end
				end
				if string.find(args[2] or '',"%-") then
					code1, args[2] = string.match(args[2] or '',"^([^%-]*)%-(.*)$")
					args[1] = args[1].."-"..code1
					return p.luacode(args)
				end
				return cats('nosubdivision', args)
			end
		end
		if string.find(args[1] or '',"%-") then
			args[1] = string.match(args[1] or '',"^([^%-]*)%-(.*)$")
			return p.luacode(args)
		end
		return cats('nocountry', args)
	end

end

--[[----------P . C O D E---------]]--											-- Calls P.Luacode but using Module:Arguments

function p.code(frame)

	return p.luacode(getArgs(frame)) or ""

end

--[[----------P . N U M E R I C---------]]--									-- Calls P.Luacode but using Module:Arguments and setting it to output a numeric value

function p.numeric(frame)

	local args = getArgs(frame)
	
	args["codetype"]="numeric"
	
	return p.luacode(args) or ""
	
end
	
--[[----------P . L U A N A M E---------]]--									-- Makes the ISO/common name of a country
	
function p.luaname(args)

	local code1 = p.luacode(args)
	local code2 = ''
		
	if string.find(code1,"%-") then
		code1, code2 = string.match(code1,"^([^%-]*)%-(.*)$")
	end
	
	if string.find(code1,"^%u%u$") then
		if code2=="" then														--3166-1 alpha-2 code
			if data[code1] then
				return (args.isoname or args.lang) and isoname(data,code1,args.lang)
					or (data[code1]["displayname"] or data[code1]["name"])
			else
				return cats('nocountry', args)
			end
		else																	--3166-2 code
			local sdata
			if data[code1] then
				sdata = mw.loadData("Module:ISO 3166/data/"..code1)
			else
				return cats('nocountry', args)
			end
			if sdata[code2] then
				return (args.isoname or args.lang) and isoname(sdata,code2,args.lang)
					or (sdata[code2]["displayname"] or sdata[code2]["name"])
			else
				return cats('nocountry', args)
			end
		end
	end
	
end

--[[----------P . N A M E---------]]--											-- Calls P.Luaname but using Module:Arguments

function p.name(frame)

	return p.luaname(getArgs(frame)) or ""

end
	
--[[----------P . G E O C O O R D I N S E R T---------]]--						-- Wrapper for Module:Coordinates.coordinsert
function p.geocoordinsert(frame)
	-- {{#invoke:ISO 3166|geocoordinsert|{{coord|...}}
	-- |country=..|subdivision1=...|subdivision2=...
	-- |type=...|scale=...|dim=...|source=...|globe=...
	-- }}
	local args = frame.args
	local subdivisionqueried = false
	local tracking = ''
	local targs = {}
	targs[1] = args[1] or ''
	for i, v in pairs(args) do
		if i == 'country' and not mw.ustring.find(targs[1], 'region:') then
			local country = v
			local k, region = 1, ''
			-- look for a valid subdivision
			while region == '' and k < 3 do
				local subdivision = args['subdivision' .. k] or ''
				if subdivision ~= '' then
					region = p.luacode({country, subdivision, nocat = 'true'})
					subdivisionqueried = true
				end
				k = k + 1
			end
			-- subdivision lookup failed or never attempted, try country only
			if region == '' then
				region = p.luacode({country, nocat = 'true'})
				if region == '' then
					tracking = tracking .. cats('nocountry', args)
				elseif subdivisionqueried == true then
					tracking = tracking .. cats('nosubdivision', args)
				end
			end
			-- something worked, add it to the targs
			if region ~= '' then
				targs[#targs + 1] = 'region:' .. region
			end
		elseif i == 'type' or i == 'scale' or i == 'dim' 
				or i == 'source' or i == 'globe' then
			targs[#targs + 1] = i .. ':' .. v
		end
	end
	-- call Module:Coordinates.coordinsert if there is something to insert
	if #targs > 1 then
		local coordinsert = require('Module:Coordinates').coordinsert
		return coordinsert({args = targs}) .. tracking
	end
	-- otherwise, just return the coordinates
	return targs[1] .. tracking
end

return p
井底之蛙的寓意是什么 太公是什么意思 克罗恩病有什么症状 吹泡泡什么意思 后期是什么意思啊
熬夜为什么会胖 女装什么牌子好 ped是什么意思 提报是什么意思 84消毒液不能和什么一起用
长豆角叫什么 hpv什么病 梅毒和艾滋病有什么区别 公关是干什么的 1020是什么星座
揩油是什么 七情六欲指的是什么 良人什么意思 上海龙华医院擅长什么 茵是什么意思
眉头有痣代表什么hcv8jop4ns1r.cn 角化棘皮瘤是什么病hcv8jop2ns1r.cn 孩子为什么有胎记hcv8jop8ns6r.cn 人工荨麻疹是什么原因引起的hcv7jop9ns9r.cn 夫妻合葬有什么讲究hcv9jop3ns1r.cn
b细胞淋巴肿瘤是一种什么病hcv8jop9ns0r.cn 包皮看什么科hcv9jop0ns8r.cn ella是什么意思hcv8jop4ns9r.cn 珉字五行属什么hcv8jop0ns9r.cn 梦见自己被火烧是什么意思hcv8jop5ns2r.cn
望梅止渴是什么意思hcv8jop4ns7r.cn yair是什么牌子的空调hcv7jop5ns1r.cn 手指腱鞘炎是什么原因造成的hcv9jop0ns0r.cn 胎位左枕前是什么意思hcv9jop3ns0r.cn 肝fnh是什么病hcv7jop7ns2r.cn
舌根部淋巴滤泡增生吃什么药hcv8jop0ns5r.cn sneakers是什么意思hcv9jop2ns9r.cn psd是什么意思hcv8jop6ns8r.cn 洗手做羹汤是什么意思hcv8jop7ns5r.cn 598是什么意思hcv8jop1ns4r.cn
百度