Jump to content

Module:PinyinBopo-short

ពីWiktionary

Documentation for this module may be created at Module:PinyinBopo-short/doc

local export = {}
 
local tt = {
["a"]="ㄚ",["ai"]="ㄞ",["an"]="ㄢ",["ang"]="ㄤ",["ao"]="ㄠ",
["ba"]="ㄅㄚ",["bai"]="ㄅㄞ",["ban"]="ㄅㄢ",["bang"]="ㄅㄤ",["bao"]="ㄅㄠ",["bei"]="ㄅㄟ",["ben"]="ㄅㄣ",["beng"]="ㄅㄥ",["bi"]="ㄅㄧ",["bian"]="ㄅㄧㄢ",["biao"]="ㄅㄧㄠ",["bie"]="ㄅㄧㄝ",["bin"]="ㄅㄧㄣ",["bing"]="ㄅㄧㄥ",["bo"]="ㄅㄛ",["bu"]="ㄅㄨ",
-- tone numbers to tone marks
--["1"]="", ["2"]="ˊ", ["3"]="ˇ", ["4"]="ˋ", ["5"]="˙",

["1"] = string.format ("%s", ""),
["2"] = string.format ("%s", "ˊ"),
["3"] = string.format ("%s", "ˇ"),
["4"] = string.format ("%s", "ˋ"),
["5"] = string.format ("%s", "˙"),
 
};
 
function export.convert(text, lang, sc)
	if type(text) == 'table' then
		text = text.args[1]
	end
	return (mw.ustring.gsub(text, '.', tt))
end
 
return export