模块:读音显示:修订间差异
来自潮语辞书
更多操作
小无编辑摘要 标签:手工回退 |
小无编辑摘要 |
||
(未显示同一用户的7个中间版本) | |||
第10行: | 第10行: | ||
local mode = frame.args[2] or "潮拼" | local mode = frame.args[2] or "潮拼" | ||
local | local region_order = { | ||
"饶平-三饶片", | |||
"饶平-黄冈片", | |||
"饶平-南澳片", | |||
"海阳-府城片", | |||
"海阳-潮安片", | |||
"澄海-澄城片", | |||
"澄海-东里片", | |||
"汕头-埠区片", | |||
"潮阳-外山片", | |||
"潮阳-内山片", | |||
"潮阳-榕腔片", | |||
"揭阳-榕城片", | |||
"揭阳-棉湖片", | |||
"惠来-惠城片", | |||
"惠来-葵潭片", | |||
"惠来-靖海片", | |||
"普宁-洪阳片", | |||
"普宁-流沙片", | |||
"丰顺片", | |||
"域外方音" | |||
} | |||
local region_groups = { | |||
["饶平-三饶片"] = { "三饶", "凤凰", "新丰", "新塘", "汤溪", "浮山", "浮滨", "东山" }, | |||
["饶平-黄冈片"] = { "黄冈", "联饶", "樟溪", "新圩", "钱东", "海山", "汫洲" }, | |||
["饶平-南澳片"] = { "后宅", "深澳", "青澳", "所城", "大埕" }, | |||
["海阳-府城片"] = { "府城", "铁铺", "古巷", "凤塘", "意溪", "赤凤", "归湖", "浮洋" }, | |||
["海阳-潮安片"] = { "庵埠", "铁铺", "磷溪", "官塘", "沙溪", "金石", "东凤", "江东" }, | |||
["澄海-澄城片"] = { "澄城", "莲阳", "上华", "隆都", "坝头", "外砂", "新溪" }, | |||
["澄海-东里片"] = { "东里", "盐鸿", "溪南", "莲华" }, | |||
["汕头-埠区片"] = { "埠区", "鮀浦", "角石", "欧汀" }, | |||
["潮阳-外山片"] = { "棉城", "金浦", "河溪", "西胪", "达濠", "河浦", "珠浦", "广澳", "海门" }, | |||
["潮阳-内山片"] = { "峡山", "和平", "铜孟", "谷饶", "井都", "陇田", "雷岭", "红场", "成田", "胪岗", "两英", "仙城", "司马浦" }, | |||
["潮阳-榕腔片"] = { "金灶", "关埠" }, | |||
["揭阳-榕城片"] = { "榕城", "梅云", "渔湖", "地都", "炮台", "登岗", "曲溪", "磐东", "云路", "玉滘", "霖磐", "月城", "白塔", "龙尾", "桂岭", "锡场", "新亨", "玉湖", "埔田" }, | |||
["揭阳-棉湖片"] = { "棉湖", "凤江", "东园", "塔头", "金和", "钱坑", "大溪", "灰寨" }, | |||
["惠来-惠城片"] = { "惠城", "华湖", "神泉", "东陇", "岐石", "隆江", "溪西" }, | |||
["惠来-葵潭片"] = { "葵潭", "鳌江", "东港" }, | |||
["惠来-靖海片"] = { "靖海", "仙庵", "周田", "前詹" }, | |||
["普宁-洪阳片"] = { "洪阳", "广太", "南溪", "赤岗", "大坝", "梅塘", "里湖" }, | |||
["普宁-流沙片"] = { "流沙", "燎原", "池尾", "大南山", "麒麟", "南径", "占陇", "军埠", "下架山" }, | |||
["丰顺片"] = { "汤坑", "汤南", "汤西", "留隍", "黄金" }, | |||
["域外方音"] = { "泰国", "南洋" } | |||
} | |||
local function renderRegions(regions) | local function renderRegions(regions) | ||
第29行: | 第72行: | ||
return table.concat(items, "\n") | return table.concat(items, "\n") | ||
end | end | ||
local class = (mode == "IPA") and "pronunciation-ipa" or "pronunciation-chao" | local class = (mode == "IPA") and "pronunciation-ipa" or "pronunciation-chao" | ||
local html = { string.format('<div class="entry-section regional-pronunciation-section %s">', class) } | |||
table.insert(html, "<h2>各地方音</h2>") | |||
local | for _, group_name in ipairs(region_order) do | ||
local regions = region_groups[group_name] | |||
if regions then | |||
table.insert(html, '<div class="region-group">') | |||
table.insert(html, string.format('<div class="shanggu-serif"><big>%s</big></div>', group_name)) | |||
table.insert(html, "<ul class=\"dialect-list\">") | |||
table.insert(html, renderRegions(regions)) | |||
table.insert(html, "</ul></div>") | |||
end | |||
end | |||
return html | table.insert(html, "</div>") | ||
return table.concat(html, "\n") | |||
end | end | ||
return p | return p |
2025年7月12日 (六) 05:12的最新版本
此模块的文档可以在模块:读音显示/doc创建
local p = {}
local mw = mw
function p.render(frame)
local char = frame.args[1]
if not char or char == "" then
return "错误:缺少字。"
end
local mode = frame.args[2] or "潮拼"
local region_order = {
"饶平-三饶片",
"饶平-黄冈片",
"饶平-南澳片",
"海阳-府城片",
"海阳-潮安片",
"澄海-澄城片",
"澄海-东里片",
"汕头-埠区片",
"潮阳-外山片",
"潮阳-内山片",
"潮阳-榕腔片",
"揭阳-榕城片",
"揭阳-棉湖片",
"惠来-惠城片",
"惠来-葵潭片",
"惠来-靖海片",
"普宁-洪阳片",
"普宁-流沙片",
"丰顺片",
"域外方音"
}
local region_groups = {
["饶平-三饶片"] = { "三饶", "凤凰", "新丰", "新塘", "汤溪", "浮山", "浮滨", "东山" },
["饶平-黄冈片"] = { "黄冈", "联饶", "樟溪", "新圩", "钱东", "海山", "汫洲" },
["饶平-南澳片"] = { "后宅", "深澳", "青澳", "所城", "大埕" },
["海阳-府城片"] = { "府城", "铁铺", "古巷", "凤塘", "意溪", "赤凤", "归湖", "浮洋" },
["海阳-潮安片"] = { "庵埠", "铁铺", "磷溪", "官塘", "沙溪", "金石", "东凤", "江东" },
["澄海-澄城片"] = { "澄城", "莲阳", "上华", "隆都", "坝头", "外砂", "新溪" },
["澄海-东里片"] = { "东里", "盐鸿", "溪南", "莲华" },
["汕头-埠区片"] = { "埠区", "鮀浦", "角石", "欧汀" },
["潮阳-外山片"] = { "棉城", "金浦", "河溪", "西胪", "达濠", "河浦", "珠浦", "广澳", "海门" },
["潮阳-内山片"] = { "峡山", "和平", "铜孟", "谷饶", "井都", "陇田", "雷岭", "红场", "成田", "胪岗", "两英", "仙城", "司马浦" },
["潮阳-榕腔片"] = { "金灶", "关埠" },
["揭阳-榕城片"] = { "榕城", "梅云", "渔湖", "地都", "炮台", "登岗", "曲溪", "磐东", "云路", "玉滘", "霖磐", "月城", "白塔", "龙尾", "桂岭", "锡场", "新亨", "玉湖", "埔田" },
["揭阳-棉湖片"] = { "棉湖", "凤江", "东园", "塔头", "金和", "钱坑", "大溪", "灰寨" },
["惠来-惠城片"] = { "惠城", "华湖", "神泉", "东陇", "岐石", "隆江", "溪西" },
["惠来-葵潭片"] = { "葵潭", "鳌江", "东港" },
["惠来-靖海片"] = { "靖海", "仙庵", "周田", "前詹" },
["普宁-洪阳片"] = { "洪阳", "广太", "南溪", "赤岗", "大坝", "梅塘", "里湖" },
["普宁-流沙片"] = { "流沙", "燎原", "池尾", "大南山", "麒麟", "南径", "占陇", "军埠", "下架山" },
["丰顺片"] = { "汤坑", "汤南", "汤西", "留隍", "黄金" },
["域外方音"] = { "泰国", "南洋" }
}
local function renderRegions(regions)
local items = {}
for _, region in ipairs(regions) do
local reading = frame:callParserFunction{
name = "#invoke",
args = { "字表调用", "getReading", char, region, mode }
}
table.insert(items,
string.format(
'<li><span class="place">%s</span><span class="pronunciation">%s</span></li>',
region, reading or "查无"
)
)
end
return table.concat(items, "\n")
end
local class = (mode == "IPA") and "pronunciation-ipa" or "pronunciation-chao"
local html = { string.format('<div class="entry-section regional-pronunciation-section %s">', class) }
table.insert(html, "<h2>各地方音</h2>")
for _, group_name in ipairs(region_order) do
local regions = region_groups[group_name]
if regions then
table.insert(html, '<div class="region-group">')
table.insert(html, string.format('<div class="shanggu-serif"><big>%s</big></div>', group_name))
table.insert(html, "<ul class=\"dialect-list\">")
table.insert(html, renderRegions(regions))
table.insert(html, "</ul></div>")
end
end
table.insert(html, "</div>")
return table.concat(html, "\n")
end
return p