local export = {}
local variety_data = require("Module:zh/data/dial")
function export.keys(frame)
local ks = {}
for k, t in pairs(variety_data) do
table.insert(ks, k)
end
return 'enwikt_keys = {"' .. table.concat(ks, '", "') .. '"}'
end
function export.showkeys(frame)
local query = mw.text.split(frame.args, ' ') -- {"Bangkok-C","Nanxiong-ZJ","Nan'ao-HZ","Nan'ao-YA"}
local data = require("Module:User:QFQ/zh-dial-map-helper/data")
function dump(h, t)
local ret = {}
local ordered_table = require("Module:User:QFQ/ordered-table")
local todo = ordered_table {}
-- reverse: { ="Mandarin",="Cantonese",="Gan",="Hakka",="Huizhou",="Jin",="Jiuxing Yumin",="Min Bei",="Min Dong",="Min Nan",="Puxian Min",="Min Zhong",="Zhongshan Min",="Northern Pinghua",="Southern Pinghua",="Shehua",="Waxiang",="Wu",="Xiang" }
todo = function(s) local t = { ="官話",="粵語",="贛語",="客家語",="徽語",="晉語",="九姓漁民船上話",="閩北語",="閩東語",="閩南語",="莆仙語",="閩中語",="中山閩語",="北部平話",="南部平話",="畲話",="瓦鄉話",="吳語",="湘語" }; return '"' .. t .. '"' end
todo = function(s) return '"' .. s .. '"' end
todo = function(s) return '"' .. s .. '"' end
todo = function(s) return s end
todo = function(s) return s end
for k, f in pairs(todo) do
if t then
table.insert(ret, string.format('\t%s = %s', k == 'chinese' and 'english' or k, f(t)))
end
end
return string.format('variety_data = {\n%s\n}', h, table.concat(ret, ',\n'))
end
local ret = {}
for _, k in pairs(query) do
table.insert(ret, string.format("-- after %s", data))
table.insert(ret, dump(k, data))
end
return frame:extensionTag('syntaxhighlight', table.concat(ret, '\n'), { lang = 'lua' } )
end
function export.count(frame)
local ks = {}
for k, t in pairs(variety_data) do
table.insert(ks, k)
end
return #ks
end
function export.test(frame)
local query = mw.text.split(frame.args, ' ') -- {"Bangkok-C","Nanxiong-ZJ","Nan'ao-HZ","Nan'ao-YA"}
local data = require("Module:User:QFQ/zh-dial-map-helper/data")
function dump(h, t)
local ret = {}
local ordered_table = require("Module:User:QFQ/ordered-table")
local todo = ordered_table {}
-- reverse: { ="Mandarin",="Cantonese",="Gan",="Hakka",="Huizhou",="Jin",="Jiuxing Yumin",="Min Bei",="Min Dong",="Min Nan",="Puxian Min",="Min Zhong",="Zhongshan Min",="Northern Pinghua",="Southern Pinghua",="Shehua",="Waxiang",="Wu",="Xiang" }
todo = function(s) local t = { ="官話",="粵語",="贛語",="客家語",="徽語",="晉語",="九姓漁民船上話",="閩北語",="閩東語",="閩南語",="莆仙語",="閩中語",="中山閩語",="北部平話",="南部平話",="畲話",="瓦鄉話",="吳語",="湘語" }; return '"' .. t .. '"' end
todo = function(s) return '"' .. s .. '"' end
todo = function(s) return '"' .. s .. '"' end
todo = function(s) return s end
todo = function(s) return s end
for k, f in pairs(todo) do
if t then
table.insert(ret, string.format('\t%s = %s', k == 'chinese' and 'english' or k, f(t)))
end
end
return string.format('variety_data = {\n%s\n}', h, table.concat(ret, ',\n'))
end
local ret = {}
for _, k in pairs(query) do
table.insert(ret, string.format("-- after %s", data))
table.insert(ret, dump(k, data))
end
return frame:extensionTag('syntaxhighlight', table.concat(ret, '\n'), { lang = 'lua' } )
end
return export