text:
Module:cmn-pron

local export = {} local m_str_utils = require("Module:string utilities") local cmn = require("Module:languages").getByCode("cmn")

local find = m_str_utils.find local gsub = m_str_utils.gsub local len = m_str_utils.len local match = m_str_utils.match local gmatch = m_str_utils.gmatch local sub = m_str_utils.sub local split = m_str_utils.split local gsplit = m_str_utils.gsplit local lower = m_str_utils.lower local upper = m_str_utils.upper local format = string.format local u = m_str_utils.char local toNFD = mw.ustring.toNFD local toNFC = mw.ustring.toNFC local trim = mw.text.trim

local pua = {} for i = 1, 7 do	pua[i] = u(0xF000+i-1) end

local m_data = mw.loadData("Module:cmn-pron/data") local m_zh = require("Module:zh") local _m_zh_data = nil local hom_data = nil

local function track(page) local tracking_page = "cmn-pron/" .. page require("Module:debug/track")(tracking_page) return true end

local function hom_data_part(pinyin) local x = toNFD(pinyin):sub(1,1) if "a" <= x and x <= "g" then return 1 elseif "h" <= x and x <= "m" then return 2 elseif "n" <= x and x <= "w" then return 3 end return 4 end

local function get_hom_data(py) if hom_data == nil then hom_data = require("Module:zh/data/cmn-hom/" .. hom_data_part(py)) end return hom_data end

-- if not empty local function ine(var) if var == "" then return nil else return var end end

local breve, hacek, circumflex = u(0x306), u(0x30C), u(0x302) local function input_error(text) if type(text) ~= "string" then return end local subs, err = {[breve] = hacek, [circumflex] = "h", ["ŋ"] = "ng", ["Ŋ"] = "Ng"} text = toNFD(text) if find(text, breve) and (find(text, "[zcsZCS]" .. circumflex) or find(text, "[ŋŊ]")) then err = "a breve and an uncommon shorthand" elseif find(text, breve) then err = "a breve" elseif find(text, "[zcsZCS]" .. circumflex) or find(text, "[ŋŊ]") then err = "an uncommon shorthand" end if err then error('The pinyin text "' .. text .. '" contains ' .. err .. '. Replace it with "' .. gsub(text, ".", subs) .. '".', 2) end end

local function m_zh_data if _m_zh_data == nil then _m_zh_data = require("Module:zh/data/cmn-tag") end; return _m_zh_data; end

function export.py_detone(text) return toNFC(gsub(toNFD(text), "[̄́̌̀]", "")) end

function export.tone_determ(text) text = toNFD(text) return m_data.py_tone_mark_to_num[match(text, m_data.tones)] or '5' end

local function sup(text) local ret = mw.html.create("sup"):wikitext(text) return tostring(ret) end

function export.py_transf(text) return export.py_detone(text) .. export.tone_determ(text) end

local function decompose_tones(text) return (toNFD(text):gsub("[EeUu]\204[\130\136]", toNFC)) end

function export.py_transform(text, detone, not_spaced) if find(text, "") then error("Pinyin contains the hidden character:  (U+200B). Please remove that character from the text.") elseif find(text, "%d") then -- e.g. ma1 instead of mā		error("Numbered tones should be given with tone marks instead.") end local tones = m_data.tones detone = ine(detone) not_spaced = ine(not_spaced) text = decompose_tones(text) text = text :gsub("\204[\128\129\132\140]", {["̄"] = "\1", ["́"] = "\2", ["̌"] = "\3", ["̀"] = "\4"}) :gsub("\195[\138\156\170\188]", {["ê"] = "\5", ["ü"] = "\6", ["Ê"] = "\14", ["Ü"] = "\15"}) :gsub("\228\184[\128\141]", {["一"] = "\7", ["不"] = "\8"}) local function plaintext(text) return (text:gsub("\16([\1-\4])", "n%1g")			:gsub("[\1-\8\14-\18]", function(m) return ({"\204\132", "\204\129", "\204\140", "\204\128", "ê", "ü", "一", "不", [14] = "Ê", [15] = "Ü", [16] = "ng", [17] = "gn", [18] = "'"})[m:byte] end)) end if not not_spaced then local i = 1 local function check_apostrophes(check_text) i = i + 1 local new_text = check_text :gsub("([^mnMN][\1-\4][iouIOU]?)([aeiou\5\6AEIOU\14\15]%f[\1-\4])", "%1'%2") :gsub("([\1-\4])([aeiou\5\6AEIOU\14\15]%f[\1-\4])", "%1'%2") :gsub("([a-gi-zA-GI-Z\5\6\14\15])([mnMN]%f[\1-\4])", "%1'%2") :gsub("([b-dfgj-np-tv-zB-DFGJ-NP-TV-Z])([mnMN]%f[%z%s%p])", "%1'%2") :gsub("([mnMN][\1-\4])([mnMN]%f[%z%s%p])", "%1'%2") :gsub("([\7\8])([aeiou\5\6mnAEIOU\14\15MN]%f[\1-\4%z%s%p])", "%1'%2") if new_text ~= check_text then check_apostrophes(new_text) elseif new_text ~= text then error(("Missing apostrophe before null-initial syllable - should be \"%s\" instead."):format(plaintext(new_text)), i)			end end check_apostrophes(text) end local check_text = gsub(text,"([AOEaoe])([iou])(" .. tones .. ")", "%1%3%2")	check_text = gsub(check_text,"([iuü])(" .. tones .. ")([aeiou])", "%1%3%2") if text ~= check_text then error("Incorrect diacritic placement in Pinyin - should be \"".. check_text .. "\" instead.") end text = lower(text) :gsub(" *([,.?]) *", " %1 ") :gsub("[#0]", {["#"] = " #", ["0"] = "5"}) :gsub("%. +%. +%.", "...") :gsub("(%d)([%a\5-\8])", "%1 %2") :gsub("n([\1-\4]?)g", "\16%1") :gsub("%f[^aeiou\1-\6]\16%f[aeiou\1-\6]", "ng") :gsub("gn%f[aeiou\5\6]", "\17") :gsub("'r", "\18r") :gsub("\18r([aeiou\5\6])", "'r%1") :gsub("([aeiou\5\6][\1-\4]?[mn\16]?\18?r?)([bpmfvdtnlgkhjqxzcsywr\16\17\7\8])", "%1 %2") :gsub("([mn\16\7\8][\1-\4]?\18?r?)([bpmfvdtnlgkhjqxzcsywr\16\17\7\8])", "%1 %2") :gsub(" r%f[%z%d%s'%-]", "r") :gsub("([aeiou\5\6][\1-\4]?) ([mn\16])%f[%z%d%s'%-]", "%1%2") :gsub("['%-]", " ") if detone or text:find("%d") then text = text :gsub("([\1-\4])([^ ]*)", function(m1, m2)				return m2 .. m1:byte			end) :gsub("[^%d\7\8]%f[%z%s,.?]", "%05") :gsub("([\7\8]\18?r)5", "%1") end text = plaintext(text) if not_spaced then text = text:gsub(" ", "") end return (toNFC(trim(text)):gsub(" +", " ")) end

local function iterate_words(text) local pos, word, non_word local function get_word word, non_word, pos = text:match("([^%s]+)([%s]*)", pos) if pos then return word, non_word end end return get_word end

local function iterate_syllables(text) local cap = find(text, "^%u") text = export.py_transform(text, true) text = text :gsub("\195[\170\188]", {["ê"] = "\1", ["ü"] = "\2"}) :gsub("[zcs]h", {["zh"] = "\3", ["ch"] = "\4", ["sh"] = "\5"}) local raw_syllables = split(text, " ") local function plaintext(text) return (text and text:gsub("[\1-\8]", function(m) return ({"ê", "ü", "ẑ", "ĉ", "ŝ", "ŋ", "ɲ", "ɨ"})[m:byte] end)) end local i = 0 local function explode_syllable i = i + 1 if raw_syllables[i] then local syllable, tone, sandhi, block_sandhi = raw_syllables[i] if syllable == "" then return explode_syllable end syllable = syllable :gsub("(\228\184[\128-\141])('?r?)$", function(m, erhua)					sandhi = m					return (m:gsub(".*", {["一"] = "yi1", ["不"] = "bu4"}) :gsub("(%a+)(%d)", "%1" .. erhua .. "%2"))				end) :gsub("^#", function(m)					block_sandhi = true					return ""				end) :gsub("%d$", function(m)					tone = m					return ""				end) :gsub("ng", "\6") :gsub("gn", "\7") :gsub("([bpmfv])(o'?r?)$", "%1u%2") :gsub("([jq\7x])u", "%1\2") :gsub("[iy]u", {["iu"] = "iou", ["yu"] = "\2"}) :gsub("[eu]i", {["ei"] = "\1i", ["ui"] = "u\1i"}) :gsub("ao", "au") :gsub("[wy]", {["w"] = "u", ["y"] = "i"}) :gsub("([iu\2])e('?r?)$", "%1\1%2") :gsub("(.)o([mn\6]'?r?)$", "%1u%2") :gsub("iu", "\2") :gsub("^([^aoe\1]?[iu\2])([mn\6]'?r?)$", "%1e%2") :gsub("([iu])%1", "%1") :gsub("([\3-\5rzcs])i('?r?)$", "%1\8%2") local initial, glide1, nucleus, glide2, nasal, erhua = syllable:match("^([bpmfvdtnlgk\6hjq\7x\3-\5rzcs]?)([iu\2\8]?)([aoe\1]?)([iu]?)([mn\6]?)('?r?)$") return (syllable:gsub("[#%d]", "")), plaintext(initial), plaintext(glide1), plaintext(nucleus), glide2, plaintext(nasal), erhua, tone, sandhi, (not not block_sandhi) end end return explode_syllable end

-- Generate a normalized pinyin version as a baseline, which everything else can work from. local function normalize_py(text, no_words) local raw_words, words = split(text, " "), {} for i, word in ipairs(raw_words) do		local cap = find(word, "^%u") word = export.py_transform(word, true) word = word:gsub("\195[\170\188]", {["ê"] = "\1", ["ü"] = "\2"}) local raw_syllables, syllables = split(word, " "), {} for j, s in ipairs(raw_syllables) do			s = s				:gsub("[zcs]h", {["zh"] = "\3", ["ch"] = "\4", ["sh"] = "\5"}) :gsub("ng", "\6") :gsub("gn", "\7") :gsub("([bpmfv])(or?%d)", "%1u%2") :gsub("([jq\7x])u", "%1\2") :gsub("iu", "iou") :gsub("yu", "\2") :gsub("ui", "uei") :gsub("ao", "au") :gsub("[wy]", {["w"] = "u", ["y"] = "i"}) :gsub("([iu\2])e(r?%d)", "%1\1%2") :gsub("ue([n\6]r?)", "u%1") :gsub("io(\6r?)", "\2%1") :gsub("([iu])%1", "%1") :gsub("([\3-\5rzcs])i(r?%d)", "%1ɨ%2") :gsub("[\1-\7]", function(m)					return ({"ê", "ü", "ẑ", "ĉ", "ŝ", "ŋ", "ɲ"})[m:byte]				end) table.insert(syllables, toNFC(s)) end word = syllables if #word > 0 then word[1] = cap and gsub(word[1], "^.", upper) or word[1] table.insert(words, word) end end if no_words then local syllables = {} for _, word in ipairs(words) do			for _, s in ipairs(word) do				table.insert(syllables, s)			end end words = syllables end return words end

function export.py_ipa(text) local ipa_initials = m_data.py_ipa_initials local ipa_initials_tl = m_data.py_ipa_initials_tl local ipa_finals = m_data.py_ipa_finals local ipa_erhua = m_data.py_ipa_erhua local ipa_tl_ts = m_data.py_ipa_tl_ts local ipa_t_values = m_data.py_ipa_t_values

local tones = {} local tone_cats = {} text = lower(text) local syllables = normalize_py(text, true) for i, s in ipairs(syllables) do		if s:find("^[,.?]+$") then table.remove(syllables, i)		end end for i = 1, #syllables do		syllables[i] = syllables[i]:gsub("%d", function(m)			tone_cats[i] = m			return ""		end) if syllables[i] == "一" then tone_cats[i] = syllables[i+1] and (syllables[i+1]:match("%d") == "4" or syllables[i+1] == "ge") and "1-2" or "1-4" syllables[i] = "i" elseif syllables[i] == "不" then tone_cats[i] = syllables[i+1] and syllables[i+1]:match("%d") == "4" and "4-2" or "4" syllables[i] = "bu" end tone_cats[i] = tone_cats[i] or "5" syllables[i] = syllables[i]:gsub("#", function(m)			tone_cats[i] = "#" .. tone_cats[i]			return ""		end) end for i, s in ipairs(syllables) do		s = gsub(s, "^([bpmfvdtnlgkŋhjqɲxẑĉŝrzcs]?)([^r']+)('?r?)$", function(initial, final, erhua)			if initial == "" and find(final, "^[aeêo]") then				initial = "ˀ"			end			final = ipa_finals[final] or final			if erhua == "r" then				for i, from in ipairs(ipa_erhua[1]) do					final = gsub(toNFD(final), toNFD(from) .. "$", ipa_erhua[2][i])				end				final = toNFC(final)			end			if initial:find("[zcs]") then				final = final:gsub("ʐ", "z")			elseif initial == "" then				final = final:gsub("[iuy]̯", {["i̯"] = "j", ["u̯"] = "w", ["y̯"] = "ɥ"})			end			initial = ipa_initials[initial] or initial			if tone_cats[i] == "5" then				initial = initial:gsub(".*", ipa_initials_tl)				final = final:gsub("ɤ$", "ə")			end			return gsub(initial .. final, "ʐʐ̩", "ʐ̩")		end) local curr_tone_cat, prev_tone_cat, next_tone_cat = tone_cats[i], tone_cats[i-1], tone_cats[i+1] if curr_tone_cat == "5" then tones[i] = prev_tone_cat and ipa_tl_ts[prev_tone_cat:gsub("#", "")] or "" else tones[i] = ipa_t_values[curr_tone_cat:gsub("#", "")] end if curr_tone_cat:find("3") then if i == #tone_cats then if i > 1 then tones[i] = "²¹⁴⁻²¹⁽⁴⁾" end elseif next_tone_cat == "3" then tones[i] = "²¹⁴⁻³⁵" elseif next_tone_cat ~= "5" then tones[i] = "²¹⁴⁻²¹" end elseif curr_tone_cat == "4" and (next_tone_cat == "4" or next_tone_cat == "1-4") then tones[i] = "⁵¹⁻⁵³" elseif curr_tone_cat == "1-4" and next_tone_cat == "4" then tones[i] = "⁵⁵⁻⁵³" end syllables[i] = s .. tones[i] syllables[i] = gsub(syllables[i], "#", "") end return table.concat(syllables, " ") end

function export.py_number_to_mark(text) local priority = m_data.py_mark_priority local tones = m_data.py_tone_num_to_mark text = text:gsub("([^%s0-5]+)([0-5])", function(syl, tone)		for _, pattern in ipairs(priority) do			local syl, n = gsub(syl, pattern, "%0" .. (tones[tone] or ""))			if n > 0 then				return syl			end		end		return syl .. tone	end) return toNFC(text) end

function export.py_zhuyin(text) input_error(text) local py_zhuyin_consonant = m_data.py_zhuyin_consonant local py_zhuyin_glide = m_data.py_zhuyin_glide local py_zhuyin_nucleus = m_data.py_zhuyin_nucleus local py_zhuyin_final = m_data.py_zhuyin_final local py_zhuyin_syllabic_nasal = m_data.py_zhuyin_syllabic_nasal local py_zhuyin_tone = m_data.py_zhuyin_tone local output = {} text = export.py_transform(text) for syllable, initial, glide1, nucleus, glide2, nasal, erhua, tone in iterate_syllables(text) do		if not (initial or glide1 or nucleus or glide2 or nasal) then table.insert(output, syllable) else local final = (py_zhuyin_nucleus[nucleus] or nucleus) .. (py_zhuyin_glide[glide2] or glide2) final = (py_zhuyin_final[final] or final) .. (py_zhuyin_consonant[nasal] or nasal) final = ((py_zhuyin_glide[glide1] or glide1) .. (py_zhuyin_final[final] or final)) :gsub("(\227\132[\167-\169])ㄜ", "%1") syllable = (py_zhuyin_consonant[initial] or initial) .. final if initial:find("[bpmfv]") and syllable:find("ㄨㄛ$") then syllable = syllable:gsub("ㄨ", "") end syllable = syllable:gsub("^\227\132[\135\139\171]$", py_zhuyin_syllabic_nasal) :gsub("\227\132[\135\139\171]$", " %0 ") if syllable == "ㄜ" and erhua == "r" then syllable = "ㄦ" erhua = "" elseif #erhua > 0 then erhua = "ㄦ" end if tone == "5" then syllable = py_zhuyin_tone[tone] .. syllable .. erhua else syllable = syllable .. py_zhuyin_tone[tone] .. erhua end table.insert(output, syllable) end end return table.concat(output, " ") end

function export.zhuyin_py(text) local zhuyin_py_initial = m_data.zhuyin_py_initial local zhuyin_py_final = m_data.zhuyin_py_final local zhuyin_py_tone = m_data.zhuyin_py_tone local word = split(text, " ", true) local function process_syllable(syllable) syllable = gsub(syllable, "^([ㄓㄔㄕㄖㄗㄘㄙ])([ˊˇˋ˙]?)$", "%1ㄧ%2") return gsub(syllable, "([ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄪ]?)([ㄧㄨㄩ]?[ㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄪㄫㄬㄧㄨㄩㄇ])([ˊˇˋ˙]?)(ㄦ?)", function(initial, final, tone, erhua)			initial = zhuyin_py_initial[initial]			final = zhuyin_py_final[final]			if erhua ~= "" then				final = final .. "r"			end			if initial == "" then				final = final					:gsub("^([iu])(n?g?)$", function(a, b) return gsub(a, "[iu]", {["i"] = "yi", ["u"] = "wu"}) .. b end)					:gsub("^(w?u)([in])$", "ue%2")					:gsub("^iu$", "iou")					:gsub("^([iu])", {["i"] = "y", ["u"] = "w"})					:gsub("^ong", "weng")					:gsub("^ü", "yu")			end			if initial:find("[jqx]") then				final = final:gsub("^ü", "u")			end			local tone = zhuyin_py_tone[tone]			if final:find("[ae]") then				final = final:gsub("([ae])", "%1" .. tone)			elseif final:find("i[ou]") then				final = final:gsub("(i[ou])", "%1" .. tone)			elseif final:find("[io]") then				final = final:gsub("([io])", "%1" .. tone)			else				final = gsub(final, "^([wy]?)(.)", "%1" .. "%2" .. tone)			end 			return initial .. final 		end) end for i, syllable in ipairs(word) do 		word[i] = process_syllable(syllable) end return toNFC(table.concat(word, " ")) end

function export.py_wg(text) local py_wg_consonant = m_data.py_wg_consonant local py_wg_consonant_dental = m_data.py_wg_consonant_dental local py_wg_glide = m_data.py_wg_glide local py_wg_nucleus = m_data.py_wg_nucleus local py_wg_o = m_data.py_wg_o local output = {} for word, non_word in iterate_words(text) do		local cap = find(word, "^%u") word = cap and lower(word) or word local syllables = {} for syllable, initial, glide1, nucleus, glide2, nasal, erhua, tone in iterate_syllables(word) do			if not (initial or glide1 or nucleus or glide2 or nasal) then table.insert(syllables, syllable) else if glide1 == "ɨ" and py_wg_consonant_dental[initial] then syllable = py_wg_consonant_dental[initial] .. "ŭ" else syllable = ((py_wg_consonant[initial] or initial) .. (py_wg_glide[glide1] or glide1) .. (py_wg_nucleus[nucleus] or nucleus) .. glide2 .. (py_wg_consonant[nasal] or nasal)) :gsub("ehi", "ei") :gsub("au", "ao") :gsub("iou", "iu") :gsub("ian$", "ien") if py_wg_o[initial] then syllable = syllable:gsub("ê$", "o") elseif initial ~= "ŝ" then syllable = syllable:gsub("uo$", "o") end syllable = (#glide1 > 0 and syllable:gsub("ê([mn]g?)", "%1") or syllable) :gsub("üng", "iung") if initial == "" then syllable = syllable :gsub("^.[\128-\191]*", {["i"] = "y", ["u"] = "w", ["ü"] = "yü"}) :gsub("^[yw]$", {["y"] = "i", ["w"] = "wu"}) :gsub("^([wyo])([mn])", function(m1, m2)								return ({["w"] = "wê", ["y"] = "yi", ["o"] = "u"})[m1] .. m2							end) elseif glide1 == "u" and not initial:find("[gk]") then syllable = syllable:gsub("uei", "ui") end end if syllable == "o" and nucleus == "e" and erhua == "r" then syllable = "êrh" erhua = "" elseif #erhua > 0 then erhua = "-ʼrh" end table.insert(syllables, syllable .. tone:gsub("%d", sup) .. erhua) end end syllables[1] = cap and gsub(syllables[1], "^.", upper) or syllables[1] word = table.concat(syllables, "-") :gsub("%-([,.?])", "%1") table.insert(output, word .. non_word) end return table.concat(output) end

local function temp_bg(text, bg) if bg == 'y' then return '<' .. text .. '>'	end return text end local function make_bg(text, bg) if bg == 'y' then return ' ' .. text .. ' '	else return text end end

function export.py_gwoyeu(text, original_text) local initials = m_data.py_gwoyeu_initial local finals = m_data.py_gwoyeu_final if text:find('^%s') or text:find('%s$') then error('invalid spacing') end local words = split(text, " ") local count = 0 for i, word in ipairs(words) do		local cap = find(toNFD(word), "^%u") word = export.py_transform(word, true, true) word = gsub(word, "([1-5])", "%1 ") word = gsub(word, " $", "") word = gsub(word, '([!-/:-@%[-`{|}~！-／：-＠［-｀｛-･])', ' %1 ') word = gsub(word, ' +', ' ') word = gsub(word, ' $', '') word = gsub(word, '^ ', '') local syllables = split(word, " ") for j, syllable in ipairs(syllables) do			count = count + 1 if not find(syllable, '^[!-/:-@%[-`{|}~！-／：-＠［-｀｛-･]+$') then local current = sub(mw.title.getCurrentTitle.text, count, count) if find(current, '^[一七八不]$') then local exceptions = {['一'] = 'i', ['七'] = 'chi', ['八'] = 'ba', ['不'] = 'bu'} syllables[j] = exceptions[current] else local initial, final, tone = , , '' syllable = gsub(syllable, '([jqxy])u', '%1ü') syllable = gsub(syllable, '^([zcsr]h?)i(r?[1-5])$', '%1ɨ%2') if find(syllable, '([bpmfvdtnlgkhjqxzcsryw]?h?)([iuü]?[aoeiɨuüê][ioun]?g?r?)([1-5])') then syllable = gsub(syllable, '([bpmfvdtnlgkhjqxzcsryw]?h?)([iuü]?[aoeiɨuüê][ioun]?g?r?)([1-5])', function(a, b, c)							initial = initials[a] or error('Unrecognised initial:' .. a); final = finals[b] or error('Unrecognised final:' .. b); tone = c							return (initial .. final .. tone) end) elseif not (find(mw.title.getCurrentTitle.text, "[们們呒呣哏唔哼哦嗯嘸噷姆欸誒诶麼ㄇㄝM]") or find(mw.title.getCurrentTitle.text, "cmn-pron/testcases", 1, true)) then error('Unrecognised syllable:' .. syllable) end local original = initial..final..tone if initial:find('^[iu]$') then final = initial .. final initial = '' end if initial .. final == "e'l" then final = "el" end final = gsub(final, '([iu])%1', '%1') local len = len(initial) + len(final) local detone = initial..final local replace = detone local fullstop = false if tone == 5 or tone == '5' then fullstop = true if original_text then tone = split(export.py_transform(original_text, true), ' ')[count]:match('[1-5]') elseif initial:find('^[lmnr]$') then tone = 2 else tone = 1 end if tone == 5 or tone == '5' then tone = export.tone_determ(m_zh.py(current)) end end if tone == 1 or tone == '1' then if initial:find('^[lmnr]$') then replace = initial .. 'h' .. sub(detone, 2, len) else replace = detone end elseif tone == 2 or tone == '2' then if not initial:find('^[lmnr]$') then if final:find('^[iu]') then replace = gsub(detone, '[iu]', {['i'] = 'y', ['u'] = 'w'}, 1) replace = gsub(replace, '[yw]l?$', {['y'] = 'yi', ['w'] = 'wu', ['wl'] = 'wul',}) else replace = gsub(detone, '([aiueoyè]+)', '%1r') end else replace = detone end elseif tone == 3 or tone == '3' then if final:find("^iu?e'l$") then detone = gsub(detone, "'", '') end detone = gsub(detone, '^[iu]', {['i'] = 'yi', ['u'] = 'wu'}) if final:find('[aeiou][aeiou]') and (not final:find('^[ie][ie]') or initial..final=="ie") and (not final:find('^[uo][uo]') or initial..final=="uo") then replace = gsub(detone, '[iu]', {['i'] = 'e', ['u'] = 'o'}, 1) elseif final:find('[aoeiuyè]') then replace = gsub(detone, '([iuyw]?)([aoeiuyè])', '%1%2%2', 1) else error('Unrecognised final:'..final) end elseif tone == 4 or tone == '4' then if final:find("^iu?e'l$") then detone = gsub(detone, "'", '') end detone = gsub(detone, '^[iu]', {['i'] = 'yi', ['u'] = 'wu'}) if detone:find('[aeo][iu]l?$') then replace = gsub(detone, "[iu]l?$", {['i'] = 'y', ['u'] = 'w', ['ul'] = 'wl'}) elseif detone:find('[ngl]$') then replace = gsub(detone, "[ng'l]l?$", {['n'] = 'nn', ['g'] = 'q', ['l'] = 'll', ['gl'] = 'ql', ["'l"] = 'hl'}) else replace = detone .. 'h'						end replace = gsub(replace, 'yi([aeiou])', 'y%1') replace = gsub(replace, 'wu([aeiou])', 'w%1') end if fullstop then replace = '.' .. replace end syllables[j] = gsub(syllable, original, replace) end end end words[i] = table.concat(syllables, "") words[i] = cap and gsub(words[i], "^.", upper) or words[i] end return table.concat(words, " ") end

-- Converts Hanyu Pinyin into Tongyong Pinyin. function export.py_tongyong(text) local ty_tone = { ["1"] = "", ["2"] = "\204\129", ["3"] = "\204\140", ["4"] = "\204\128", ["5"] = "\204\138"	}	local function num_to_mark(syllable, tone) tone = ty_tone[tone] if tone ~= "" then if find(syllable, "[aeê]") then syllable = gsub(syllable, "([aeê])", "%1" .. tone) elseif find(syllable, "o") then syllable = gsub(syllable, "(o)", "%1" .. tone) elseif find(syllable, "[iu]") then syllable = gsub(syllable, "([iu])", "%1" .. tone) elseif find(syllable, "[mn]") then syllable = gsub(syllable, "([mn])", "%1" .. tone) end end return syllable end local words = {} for word in gsplit(text, " ") do		local cap = find(toNFD(word), "^%u") word = export.py_transform(word, true) local syllables = {} for syllable in gsplit(word, " ") do			syllable = toNFC(gsub(syllable, "([crsz]h?i)", "%1h")) syllable = gsub(syllable, "ü", "yu") syllable = gsub(syllable, "([jqx])u", "%1yu") syllable = gsub(syllable, "iu", "iou") syllable = gsub(syllable, "ui", "uei") syllable = gsub(syllable, "([wf])eng", "%1ong") syllable = gsub(syllable, "wen", "wun") syllable = gsub(syllable, "iong", "yong") syllable = gsub(syllable, "^zh", "jh") syllable = gsub(syllable, "^q", "c") syllable = gsub(syllable, "^x", "s") syllable = #syllables ~= 0 and gsub(syllable, "^([aeo])", "-%1") or syllable syllable = gsub(syllable, "^([^1-5]+)([1-5])$", num_to_mark) table.insert(syllables, syllable) end word = table.concat(syllables, "") word = cap and gsub(word, "^.", upper) or word table.insert(words, word) end return toNFC(table.concat(words, " ")) end

-- Converts Hanyu Pinyin into the Yale system. function export.py_yale(text) local yale_tone = { ["1"] = u(0x304), ["2"] = u(0x301), ["3"] = u(0x30C), ["4"] = u(0x300), ["5"] = "" }	local function num_to_mark(syllable, tone) tone = yale_tone[tone] if tone ~= "" then if find(syllable, "[ae]") then syllable = gsub(syllable, "([ae])", "%1" .. tone) elseif find(syllable, "o") then syllable = gsub(syllable, "(o)", "%1" .. tone) elseif find(syllable, "[iu]") then syllable = gsub(syllable, "([iu])", "%1" .. tone) elseif find(syllable, "[mnrz]") then syllable = gsub(syllable, "([mnrz])", "%1" .. tone) end end return syllable end local words = {} for word in gsplit(text, " ") do		local cap = find(toNFD(word), "^%u") word = export.py_transform(word, true) local syllables = {} for syllable in gsplit(word, " ") do			syllable = toNFC(gsub(syllable, "^r(%d)", "er%1")) syllable = gsub(syllable, "^([jqxy])u", "%1ü") syllable = gsub(syllable, "^(.h)i(%d)", "%1r%2") syllable = gsub(syllable, "^ri(%d)", "r%1") syllable = gsub(syllable, "^([csz])i(%d)", "%1z%2") syllable = gsub(syllable, "^zh", "j") syllable = gsub(syllable, "^.", m_data.py_yale_initial) syllable = gsub(syllable, "^tsh", "ch") syllable = gsub(syllable, "i([aeo])", "y%1") syllable = gsub(syllable, "u([ao])", "w%1") syllable = gsub(syllable, "ü([ae])", "yw%1") for chars, replacement in pairs(m_data.py_yale_two_medials) do				syllable = gsub(syllable, chars, replacement) end syllable = gsub(syllable, "ong", "ung") syllable = gsub(syllable, ".", m_data.py_yale_one_medial) syllable = gsub(syllable, "ü", "yu") syllable = gsub(syllable, "([^lwy])o(%d)$", "%1wo%2") syllable = gsub(syllable, "([yz])%1", "%1") syllable = gsub(syllable, "^([^%d]+)(%d)$", num_to_mark) table.insert(syllables, syllable) end word = table.concat(syllables, "-") word = cap and gsub(word, "^.", upper) or word table.insert(words, word) end return toNFC(table.concat(words, " ")) end

-- Converts Hanyu Pinyin into the Palladius system. function export.py_palladius(text) local words = {} for word in gsplit(text, " ") do		local cap = find(toNFD(word), "^%u") word = export.py_transform(word, true) local syllables = {} for syllable in gsplit(word, " ") do			syllable = toNFC(gsub(syllable, "%d", "")) syllable = gsub(syllable, "^([jqxy])u", "%1ü") syllable = gsub(syllable, "([mnr])(r?)$", function(m1, m2)				m1 = m_data.py_palladius_final[m1] or m1				return m1 .. (m2 == "r" and "р" or "")			end) syllable = gsub(syllable, "ng", "н") syllable = gsub(syllable, "^..", m_data.py_palladius_two_initials) syllable = gsub(syllable, "^.", m_data.py_palladius_one_initial) for chars, replacement in pairs(m_data.py_palladius_three_medials) do				syllable = gsub(syllable, chars, replacement) end for chars, replacement in pairs(m_data.py_palladius_two_medials) do				syllable = gsub(syllable, chars, replacement) end syllable = gsub(syllable, ".", m_data.py_palladius_one_medial) for chars, replacement in pairs(m_data.py_palladius_specials) do				syllable = gsub(syllable, chars, replacement) end syllable = gsub(syllable, "н$", "%1" .. pua[1]) syllable = gsub(syllable, "[ую]$", "%1" .. pua[3]) syllable = gsub(syllable, "[ая]?о$", "%1" .. pua[4]) syllable = gsub(syllable, "[ая]$", "%1" .. pua[5]) syllable = gsub(syllable, "ю?[иэ]$", "%1" .. pua[6]) syllable = gsub(syllable, "оу$", "%1" .. pua[6]) if syllable == "н" or syllable == "нь" then syllable = syllable .. pua[7] end table.insert(syllables, syllable) end word = table.concat(syllables, "") word = gsub(word, "н" .. pua[1] .. "([аеёиоуэюя])", "нъ%1") for chars, replacement in pairs(m_data.py_palladius_disambig) do			word = gsub(word, chars, replacement) end word = gsub(word, "[" .. pua[1] .. "-" .. pua[7] .. "]", "") word = cap and gsub(word, "^.", upper) or word table.insert(words, word) end return toNFC(table.concat(words, " ")) end

function export.py_format(text, cap, bg, simple) if cap == false then cap = nil end if bg == false then bg = 'n' else bg = 'y' end if simple == false then simple = nil end text = toNFD(text) local phon = text local title = mw.title.getCurrentTitle.text local cat = '' local spaced = toNFD(export.py_transform(text)) local space_count spaced, space_count = spaced:gsub(' ', '@') local consec_third_count for _ = 1, space_count do		spaced, consec_third_count = gsub(spaced, "([^@]+)̌([^#@]*)@([^#@]+̌)", function(a, b, c)			return temp_bg(a..'́'..b, bg)..'@'..c end, 1) if consec_third_count > 0 then phon = gsub(spaced, '@', '') end end text = gsub(text, "#", "") phon = gsub(phon, "#", "") if title:find('一') and not text:find('一') and not simple then cat = cat .. ''	end if text:find('[一不]') and not simple then text = gsub(text, '[一不]$', {['一'] = 'yī', ['不'] = 'bù'}) phon = gsub(phon, '[一不]$', {['一'] = 'yī', ['不'] = 'bù'}) if find(text, '一') then if find(text, '一[^̄́̌̀]*[̄́̌]') then cat = cat .. ''				phon = gsub(phon, '一([^̄́̌̀]*[̄́̌])', function(a) return temp_bg('yì', bg) .. a end) text = gsub(text, '一([^̄́̌̀]*[̄́̌])', 'yī%1') end if find(text, '一[^̄́̌̀]*̀') or find(text, '一ge$') or find(text, '一ge[^nr]') then cat = cat .. ''				phon = gsub(phon, '一([^̄́̌̀]*̀)', function(a) return temp_bg('yí', bg) .. a end) phon = gsub(phon, '一ge', temp_bg('yí', bg) .. 'ge') text = gsub(text, '一([^̄́̌̀]*[̄́̌])', 'yī%1') end end if find(text, '不 ?[bpmfvdtnlgkhjqxzcsrwy]?[ghn]?[aeiou]*̀') then cat = cat .. ''			phon = gsub(phon, '不( ?[bpmfvdtnlgkhjqxzcsrwy]?[ghn]?[aeiou]*̀)', function(a) return temp_bg('bú', bg) .. a end) end end text = gsub(text, '[一不]', {['一'] = 'yī', ['不'] = 'bù'}) text = gsub(text, '兒', function return make_bg('r', bg) end) -- character is deleted phon = gsub(phon, '[一不]', {['一'] = 'yī', ['不'] = 'bù'}) phon = gsub(phon, '<([^>]+)>', ' %1 ') if not simple then if cap then text = gsub(text, '^%l', upper) phon = gsub(phon, '^%l', upper) end local linked_text = require("Module:links").full_link{term = text, lang = cmn} if phon ~= text then text = (linked_text) .. " [Phonetic: " .. phon .. "]"		else text = linked_text end if mw.title.getCurrentTitle.nsText ~= "Template" then text = text .. cat end end return toNFC(text) end

function export.make_tl(original_text, tl_pos, bg, cap) if bg == false then bg = 'n' else bg = 'y' end local _, countoriginal = original_text:gsub(" ", " ") local spaced = export.py_transform(original_text) if sub(spaced, -1, -1) == ' ' then spaced = sub(spaced, 1, -2) end local _, count = spaced:gsub(" ", " ") local index = {} local start, finish local pos = 1 for i = 1, count, 1 do		if i ~= 1 then pos = (index[i-1] + 1) end index[i] = find(spaced, ' ', pos) end if tl_pos == 2 then start = index[count-1] - count + countoriginal + 2 finish = index[count] - count + countoriginal elseif tl_pos == 3 then start = index[count-2] - count + countoriginal + 3 finish = index[count-1] - count + countoriginal + 1 else start = count == 0 and 1 or (index[count] - count + countoriginal + 1) finish = -1 end local text = (sub(original_text, 1, start-1) .. make_bg(gsub(sub(original_text, start, finish), '.', export.py_detone), bg)) if finish ~= -1 then text = (text .. sub(original_text, finish+1, -1)) end if cap == true then text = gsub(text, '^%l', upper) end return text end

function export.tag(first, second, third, fourth, fifth) local text = "("	local tag = {}	local tagg = first or "Standard Chinese"	tag[1] = (second ~= ) and second or "Standard Chinese"	tag[2] = (third ~= ) and third or nil	tag[3] = (fourth ~= ) and fourth or nil	tag[4] = (fifth ~= ) and fifth or nil	text = text .. ((tagg == ) and table.concat(tag, ", ") or tagg) .. "'')" text = gsub(text, 'Standard Chinese', "Standard Chinese") text = gsub(text, 'Mainland', "Mainland") text = gsub(text, 'Taiwan', "Taiwan") text = gsub(text, 'Beijing', "Beijing") text = gsub(text, 'erhua', "erhua") text = gsub(text, 'Min Nan', "Min Nan") text = gsub(text, 'shangkouzi', "shangkouzi") return text end

function export.straitdiff(text, pron_ind, tag) local conv_text = text for i = 1, #text do		if m_zh_data.MT[sub(text, i, i)] then conv_text = 'y' end end if tag == 'tag' then conv_text = (conv_text == 'y') and m_zh_data.MT_tag[match(text, '[丁-丌与-龯㐀-䶵]')][pron_ind] or '' elseif pron_ind == 1 or pron_ind == 2 or pron_ind == 3 or pron_ind == 4 or pron_ind == 5 then local reading = {} for a, b in pairs(m_zh_data.MT) do			reading[a] = b[pron_ind] if reading[a] then reading[a] = gsub(reading[a], "^([āōēáóéǎǒěàòèaoe])", "'%1") end end conv_text = gsub(text, '.', reading) text = gsub(text, "^'", "") text = gsub(text, " '", " ") if conv_text == text and tag == 'exist' then return nil end end conv_text = gsub(conv_text, "^'", "") return conv_text end

function export.str_analysis(text, conv_type, other_m_vars) local MT = m_zh_data.MT	text = gsub(text, '{default}', '') text = gsub(text, '=', '—') text = gsub(text, ',', '隔') text = gsub(text, '隔 ', ', ') if conv_type == 'head' or conv_type == 'link' then if find(text, '隔cap—') then text = gsub(text, '[一不]', {['一'] = 'Yī', ['不'] = 'Bù'}) end text = gsub(text, '[一不]', {['一'] = 'yī', ['不'] = 'bù'}) end local comp = split(text, '隔', true) local reading = {} local alternative_reading = {} local zhuyin = {} --	-- not used	local param = {		'1n', '1na', '1nb', '1nc', '1nd', 'py', 'cap', 'tl', 'tl2', 'tl3', 'a', 'audio', 'er', 'ertl', 'ertl2', 'ertl3', 'era', 'eraudio',		'2n', '2na', '2nb', '2nc', '2nd', '2py', '2cap', '2tl', '2tl2', '2tl3', '2a', '2audio', '2er', '2ertl', '2ertl2', '2ertl3', '2era', '2eraudio',		'3n', '3na', '3nb', '3nc', '3nd', '3py', '3cap', '3tl', '3tl2', '3tl3', '3a', '3audio', '3er', '3ertl', '3ertl2', '3ertl3', '3era', '3eraudio',		'4n', '4na', '4nb', '4nc', '4nd', '4py', '4cap', '4tl', '4tl2', '4tl3', '4a', '4audio', '4er', '4ertl', '4ertl2', '4ertl3', '4era', '4eraudio',		'5n', '5na', '5nb', '5nc', '5nd', '5py', '5cap', '5tl', '5tl2', '5tl3', '5a', '5audio', '5er', '5ertl', '5ertl2', '5ertl3', '5era', '5eraudio'	}	-- if conv_type == '' then return comp[1] elseif conv_type == 'head' or conv_type == 'link' then for i, item in ipairs(comp) do			if not find(item, '—') then if find(item, '[一-龯㐀-䶵]') then local M, T, t = {}, {}, {} for a, b in pairs(MT) do						M[a] = b[1]; T[a] = b[2]; t[a] = b[3]; M[a] = gsub(M[a], "^([āōēáóéǎǒěàòèaoe])", "'%1") T[a] = gsub(T[a], "^([āōēáóéǎǒěàòèaoe])", "'%1") if t[a] then t[a] = gsub(t[a], "^([āōēáóéǎǒěàòèaoe])", "'%1") end end local mandarin = gsub(item, '.', M)					local taiwan = gsub(item, '.', T)					mandarin = gsub(mandarin, "^'", "") mandarin = gsub(mandarin, " '", " ") if conv_type == 'link' then return mandarin end taiwan = gsub(taiwan, "^'", "") taiwan = gsub(taiwan, " '", " ") local tt = gsub(item, '.', t)					if find(text, 'cap—') then mandarin = gsub(mandarin, '^%l', upper) taiwan = gsub(taiwan, '^%l', upper) tt = gsub(tt, '^%l', upper) end if tt == item then zhuyin[i] = export.py_zhuyin(mandarin, true) .. ', ' .. export.py_zhuyin(taiwan, true) reading[i] = mandarin .. ']], [[' .. taiwan else tt = gsub(tt, "^'", "") tt = gsub(tt, " '", " ") zhuyin[i] = export.py_zhuyin(mandarin, true) .. ', ' .. export.py_zhuyin(taiwan, true) .. ', ' .. export.py_zhuyin(tt, true) reading[i] = mandarin .. ']], [[' .. taiwan .. ']], [[' .. tt					end else if conv_type == 'link' then return item end zhuyin[i] = export.py_zhuyin(item, true) reading[i] = item if len(mw.title.getCurrentTitle.text) == 1 and #split(export.py_transform(item), " ") == 1 then local target = export.py_transf(reading[i]) alternative_reading[i] = "" .. gsub(target, '([1-5])', sup) .. "" if alternative_reading[i]:find("5") then alternative_reading[i] = alternative_reading[i] .. "／ " .. alternative_reading[i]:gsub("5", "0") end local title = mw.title.new(mw.ustring.lower(target)):getContent if not (title and title:find("")) then track("uncreated pinyin") end end end if reading[i] ~=  then reading[i] =  .. reading[i] .. '' end reading[i] = gsub(reading[i], "#", "") end comp[i] = item if conv_type == 'link' then return comp[1] end end local id = m_zh.ts_determ(mw.title.getCurrentTitle.text) local accel if id == 'trad' then accel = '' local result = other_m_vars and "*: (Standard) \n*::" or "*:" result = result .. " (Pinyin) : " .. accel .. gsub(table.concat(reading, ", "), ", ,", ",") if alternative_reading[1] then result = result .. " (" .. table.concat(alternative_reading, ", ") .. ")" end result = result .. (other_m_vars and " \n*::" or " \n*:") result = result .. " (Zhuyin) : " .. ' ' .. gsub(table.concat(zhuyin, ", "), ", ,", ",") .. " "		return result

elseif conv_type == '2' or conv_type == '3' or conv_type == '4' or conv_type == '5' then if not find(text, '隔') or (comp[tonumber(conv_type)] and find(comp[tonumber(conv_type)], '—')) then return '' else return comp[tonumber(conv_type)] end else for i = 1, #comp, 1 do local target = '^' .. conv_type .. '—'			if find(comp[i], target) then text = gsub(comp[i], target, '') return text end end text = '' end return text end

function export.homophones(pinyin) local text = '' if mw.title.getCurrentTitle.nsText == '' then local args = get_hom_data(pinyin).list[pinyin] text = ' edit ' for i, term in ipairs(args) do			if i > 1 then text = text .. " "			end if mw.title.new(term).exists and term ~= mw.title.getCurrentTitle.text then local forms = { term } local content = mw.title.new(term):getContent local template = match(content, "{{zh%-forms[^}]*}}") if template then local simp = match(template, "|s=([^|}])+") if simp then table.insert(forms, simp) end for tradVar in gmatch(template, "|t[0-9]=([^|}])+") do						table.insert(forms, tradVar) end for simpVar in gmatch(template, "|s[0-9]=([^|}])+") do						table.insert(forms, simpVar) end term = table.concat(forms, "／") end end text = text .. require("Module:links").full_link{ term = term, lang = cmn, tr = "-" } end text = text .. ''	end return text end

local function erhua(word, erhua_pos, pagename) local title = split(pagename, '') local linked_title = '' local syllables = split(export.py_transform(word), ' ') local count = #syllables erhua_pos = find(erhua_pos, '[1-9]') and split(erhua_pos, ';') or { count } for _, pos in ipairs(erhua_pos) do		pos = tonumber(pos) title[pos] = title[pos] .. '兒' syllables[pos] = syllables[pos] .. 'r'	end local title = table.concat(title) if mw.title.new(title).exists then linked_title = ' (' .. require("Module:links").full_link{ term = title, lang = cmn, tr = "-" } .. ')' end for i, syllable in pairs(syllables) do		if i ~= 1 and toNFD(syllable):find('^[aeiou]') then syllables[i] = "'" .. syllable end end word = table.concat(syllables, '') return (export.tag(, , 'erhua-ed') .. linked_title), word end

export.erhua = erhua

function export.make(frame) local args = frame:getParent.args return export.make_args(args) end

function export.make_args(args) local pagename = mw.title.getCurrentTitle.text local text = {} local reading = {args[1] or , args[2] or , args[3] or , args[4] or , args[5] or ''} args["1nb"] = ine(args["1nb"]) if reading[1] ~= '' then local title = export.tag((args["1n"] or ), (args["1na"] or ), (args["1nb"] or export.straitdiff(args[1], 1, 'tag')), (args["1nc"] or ), (args["1nd"] or )) local pinyin = export.straitdiff(reading[1], 1, '') table.insert(text, export.make_table(title, pinyin, (args["py"] or ), (args["cap"] or ), (args["tl"] or ), (args["tl2"] or ), (args["tl3"] or ), (args["a"] or args["audio"] or ))) if args["er"] and args["er"] ~= '' then title, pinyin = erhua(pinyin, args["er"], pagename) table.insert(text, export.make_table(title, pinyin, , (args["cap"] or ), (args["ertl"] or ), (args["ertl2"] or ), (args["ertl3"] or ), (args["era"] or args["eraudio"] or ), true)) end end if reading[2] ~= '' or export.straitdiff(reading[1], 2, 'exist') then if args["2nb"] and args["2nb"] ~= '' then tagb = args["2nb"] else tagb = export.straitdiff(args[1], 2, 'tag') end title = export.tag((args["2n"] or ), (args["2na"] or ), tagb, (args["2nc"] or ), (args["2nd"] or )) pinyin = (reading[2] ~= ) and reading[2] or export.straitdiff(reading[1], 2, ) table.insert(text, export.make_table(title, pinyin, (args["2py"] or ), (args["2cap"] or ), (args["2tl"] or ), (args["2tl2"] or ), (args["2tl3"] or ), (args["2a"] or args["2audio"] or ), true)) table.insert(text, '') if args["2er"] and args["2er"] ~= '' then title, pinyin = erhua(pinyin, args["2er"], pagename) table.insert(text, export.make_table(title, pinyin, , (args["2cap"] or ), (args["2ertl"] or ), (args["2ertl2"] or ), (args["2ertl3"] or ), (args["2era"] or args["2eraudio"] or ), true)) end if reading[3] ~= '' or export.straitdiff(reading[1], 3, 'exist') then if args["3nb"] and args["3nb"] ~= '' then tagb = args["3nb"] else tagb = export.straitdiff(args[1], 3, 'tag') end title = export.tag((args["3n"] or ), (args["3na"] or ), tagb, (args["3nc"] or ), (args["3nd"] or )) if reading[3] ~=  then pinyin = reading[3] else pinyin = export.straitdiff(reading[1], 3, ) end table.insert(text, export.make_table(title, pinyin, (args["3py"] or ), (args["3cap"] or ), (args["3tl"] or ), (args["3tl2"] or ), (args["3tl3"] or ), (args["3a"] or args["3audio"] or ), true)) if args["3er"] and args["3er"] ~= '' then title, pinyin = erhua(pinyin, args["3er"], pagename) table.insert(text, export.make_table(title, pinyin, , (args["3cap"] or ), (args["3ertl"] or ), (args["3ertl2"] or ), (args["3ertl3"] or ), (args["3era"] or args["3eraudio"] or ), true)) end if reading[4] ~= '' or export.straitdiff(reading[1], 4, 'exist') then if args["4nb"] and args["4nb"] ~= '' then tagb = args["4nb"] else tagb = export.straitdiff(args[1], 4, 'tag') end title = export.tag((args["4n"] or ), (args["4na"] or ), tagb, (args["4nc"] or ), (args["4nd"] or )) if reading[4] ~=  then pinyin = reading[4] else pinyin = export.straitdiff(reading[1], 4, ) end table.insert(text, export.make_table(title, pinyin, (args["4py"] or ), (args["4cap"] or ), (args["4tl"] or ), (args["4tl2"] or ), (args["4tl3"] or ), (args["4a"] or args["4audio"] or ), true)) if args["4er"] and args["4er"] ~= '' then title, pinyin = erhua(pinyin, args["4er"], pagename) table.insert(text, export.make_table(title, pinyin, , (args["4cap"] or ), (args["4ertl"] or ), (args["4ertl2"] or ), (args["4ertl3"] or ), (args["4era"] or args["4eraudio"] or ), true)) end if reading[5] ~= '' or export.straitdiff(reading[1], 5, 'exist') then if args["5nb"] and args["5nb"] ~= '' then tagb = args["5nb"] else tagb = export.straitdiff(args[1], 5, 'tag') end title = export.tag((args["5n"] or ), (args["5na"] or ), tagb, (args["5nc"] or ), (args["5nd"] or )) if reading[5] ~=  then pinyin = reading[5] else pinyin = export.straitdiff(reading[1], 5, ) end table.insert(text, export.make_table(title, pinyin, (args["5py"] or ), (args["5cap"] or ), (args["5tl"] or ), (args["5tl2"] or ), (args["5tl3"] or ), (args["5a"] or args["5audio"] or ), true)) if args["5er"] and args["5er"] ~= '' then title, pinyin = erhua(pinyin, args["5er"], pagename) table.insert(text, export.make_table(title, pinyin, , (args["5cap"] or ), (args["5ertl"] or ), (args["5ertl2"] or ), (args["5ertl3"] or ), (args["5era"] or args["5eraudio"] or ), true)) end end end end end if (args["tl"] or '') .. (args["tl2"] or '') .. (args["tl3"] or '') .. (args["2tl"] or '') .. (args["2tl2"] or '') .. (args["2tl3"] or ) ~=  then table.insert(text, '') end return table.concat(text) end

local function add_audio(text, audio, pinyin) if audio and audio ~= "" then if audio == "y" then audio = format('zh-%s.ogg', pinyin) end table.insert(text, '\n*:: [[File:')		table.insert(text, audio)		table.insert(text, ']]') table.insert(text, '') end end

function export.make_audio(args) local text, reading, pinyin = {}, {}, "" local audio = { args["a"] or args["audio"] or '', args["2a"] or args["2audio"] or '', args["3a"] or args["3audio"] or '', args["4a"] or args["4audio"] or '', args["5a"] or args["5audio"] or '', }	for i=1, 5 do		reading[i] = args[i] or '' if i == 1 then pinyin = export.straitdiff(reading[1], 1, '') else pinyin = (reading ~= ) and reading[i] or export.straitdiff(reading[1], i, ) end pinyin = export.py_format(pinyin, false, false, true) add_audio(text, audio[i], pinyin) end return table.concat(text) end

function export.make_table(title, pinyin, py, cap, tl, tl2, tl3, a, novariety) py = ine(py);cap = ine(cap);tl = ine(tl);tl2 = ine(tl2);tl3 = ine(tl3);a = ine(a);novariety = ine(novariety) local text = {} local pinyin_simple_fmt = export.py_format(pinyin, false, false, true) if not novariety then table.insert(text, '* Mandarin') else table.insert(text, ' ') end table.insert(text, '\n** ' .. title .. ' ') local hom_found if get_hom_data(pinyin_simple_fmt).list[lower(pinyin_simple_fmt)] then hom_found = true else hom_found = false table.insert(text, ' [' .. tostring(mw.uri.fullUrl("Module:zh/data/cmn-hom/" .. hom_data_part(pinyin_simple_fmt), {["action"]="edit"})) .. ' +]') end table.insert(text, "\n*** Hanyu Pinyin : ") local id = m_zh.ts_determ(mw.title.getCurrentTitle.text) if id == 'trad' then table.insert(text, '') if py then table.insert(text, py) else if cap then table.insert(text, export.py_format(pinyin, true, true)) else table.insert(text, export.py_format(pinyin, false, true)) end if tl or tl2 or tl3 then table.insert(text, ' → ') if tl then tl_pos = 1 elseif tl2 then tl_pos = 2 elseif tl3 then tl_pos = 3 end if cap then table.insert(text, export.make_tl(export.py_format(pinyin, true, false, true), tl_pos, true, true)) else table.insert(text, export.make_tl(pinyin_simple_fmt, tl_pos, true)) end end if tl then table.insert(text, ' (toneless final syllable variant) ') elseif tl2 or tl3 then table.insert(text, ' (toneless variant) ') end end table.insert(text, " \n*** Zhuyin : ") table.insert(text, ' ') table.insert(text, export.py_zhuyin(pinyin_simple_fmt, true)) if tl or tl2 or tl3 then table.insert(text, ' → ') table.insert(text, export.py_zhuyin(export.make_tl(pinyin_simple_fmt, tl_pos, false), true)) end table.insert(text, ' ') if tl then table.insert(text, ' (toneless final syllable variant) ') elseif tl2 or tl3 then table.insert(text, ' (toneless variant) ') end table.insert(text, "\n*** Tongyong Pinyin : ") if tl or tl2 or tl3 then table.insert(text, export.py_tongyong(export.make_tl(pinyin_simple_fmt, tl_pos, false), pinyin_simple_fmt)) else table.insert(text, export.py_tongyong(pinyin_simple_fmt)) end table.insert(text, ' ') table.insert(text, "\n*** Wade–Giles : ") if tl or tl2 or tl3 then table.insert(text, export.py_wg(export.make_tl(pinyin_simple_fmt, tl_pos, false), pinyin_simple_fmt)) else table.insert(text, export.py_wg(pinyin_simple_fmt)) end table.insert(text, ' ') table.insert(text, "\n*** Yale : ") if tl or tl2 or tl3 then table.insert(text, export.py_yale(export.make_tl(pinyin_simple_fmt, tl_pos, false), pinyin_simple_fmt)) else table.insert(text, export.py_yale(pinyin_simple_fmt)) end table.insert(text, ' ') table.insert(text, "\n*** Gwoyeu Romatzyh : ") if tl or tl2 or tl3 then table.insert(text, export.py_gwoyeu(export.make_tl(pinyin_simple_fmt, tl_pos, false), pinyin_simple_fmt)) else table.insert(text, export.py_gwoyeu(pinyin_simple_fmt)) end table.insert(text, ' ') table.insert(text, "\n*** Palladius : ") local palladius if tl or tl2 or tl3 then palladius = export.py_palladius(export.make_tl(pinyin_simple_fmt, tl_pos, false), pinyin_simple_fmt) else palladius = export.py_palladius(pinyin_simple_fmt) end table.insert(text, palladius) table.insert(text, " (")	table.insert(text, require("Module:ru-translit").tr(palladius, "cmn"))	table.insert(text, ") ") table.insert(text, '\n*** Sinological IPA (key) : /') table.insert(text, export.py_ipa(pinyin)) if tl or tl2 or tl3 then table.insert(text, '/ → /') table.insert(text, export.py_ipa(export.make_tl(pinyin_simple_fmt, tl_pos, false))) end table.insert(text, '/ ') -- if a then -- 	if a == 'y' then a = 'zh-' .. pinyin_simple_fmt .. '.ogg' end -- 	table.insert(text, '\n*** [[File:')	-- 	table.insert(text, a)	-- 	table.insert(text, ']] ') -- end if hom_found then table.insert(text, "\n*** Homophones : " ..			' ') end return table.concat(text) end

function export.py_headword(frame) local plain_param = {} local params = { ["head"] = plain_param, ["zhuyin"] = plain_param, ["notr"] = {type = "boolean"}, }	local args = require("Module:parameters").process(frame:getParent.args, params, nil, "cmn-pron", "py_headword") local head = args.head or mw.title.getCurrentTitle.text local head_simple = require("Module:links").remove_links(head) local Latn = require("Module:scripts").getByCode("Latn") local categories = {"Hanyu Pinyin", "Mandarin non-lemma forms"} local inflections = {} if head:find("[0-5]") then table.insert(categories, "Hanyu Pinyin with tone numbers") head = head:gsub("%d", sup) elseif not args.notr then local py_detoned = export.py_transform(head, true) if not py_detoned:find("%s") then if py_detoned:find("5") then py_detoned = py_detoned .. "//" .. py_detoned:gsub("5", "0") end py_detoned = py_detoned:gsub("%d", sup) table.insert(inflections, {py_detoned, sc = Latn}) end end if not args.notr then local Bopo = require("Module:scripts").getByCode("Bopo") head_simple = export.py_number_to_mark(head_simple) table.insert(inflections, {			label = "Zhuyin",			{				term = args.zhuyin or export.py_zhuyin(head_simple),				sc = Bopo,				nolink = true			}		}) end -- Don't pass a redundant head value, because they get categorised as redundant. if head == mw.title.getCurrentTitle.text then head = nil end return require("Module:headword").full_headword{lang = cmn, sc = Latn, heads = {head}, inflections = inflections, pos_category = "pinyin", categories = categories, noposcat = true} end

return export

title: Module:cmn-pron


text:
kropper

Etymology
From, from.

Noun

 * 1) body
 * 2) torso

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: kropper


text: Supraleitern

title: Supraleitern


text: pillarisation

title: pillarisation


text: dania

title: dania


text:
shitflood

Noun

 * 1)  A large amount.

Synonyms

 * , boatload, buttload, crapload , fuckload , fuckton , shedload , shitload

title: shitflood


text:
aufkonzentrieren

Verb

 * 1)  to concentrate something by boiling away or by evaporation

title: aufkonzentrieren


text:
Sylfaen

Etymology
From. A trademark of Microsoft Corporation.

Proper noun

 * 1) A certain serif typeface that supports Latin, Greek, Cyrillic, Armenian and Georgian.

title: Sylfaen


text: aufkonzentrierend

title: aufkonzentrierend


text:
aufkonzentriert

Adjective

 * 1) concentrated (by boiling away or evaporation)

title: aufkonzentriert


text: aufkonzentriere

title: aufkonzentriere


text: aufkonzentrierst

title: aufkonzentrierst


text: aufkonzentrierest

title: aufkonzentrierest


text: aufkonzentrieret

title: aufkonzentrieret


text: aufkonzentrierte

title: aufkonzentrierte


text: aufkonzentrierten

title: aufkonzentrierten


text: aufkonzentriertest

title: aufkonzentriertest


text: aufkonzentriertet

title: aufkonzentriertet


text: aufkonzentrier

title: aufkonzentrier


text:
Talk:Sylfaen

See Talk:sylfaen for deletion discussion. Equinox ◑ 22:36, 15 January 2014 (UTC)

title: Talk:Sylfaen


text: shitfloods

title: shitfloods


text: kroppane

title: kroppane


text: aufkonzentrierter

title: aufkonzentrierter


text: aufkonzentriertes

title: aufkonzentriertes


text: aufkonzentriertem

title: aufkonzentriertem


text: 美术馆

title: 美术馆


text: měishùguǎn

title: měishùguǎn


text: びじゅつかん

title: びじゅつかん


text: bijutsukan

title: bijutsukan


text: はっけっきゅう

title: はっけっきゅう


text: hakkekkyū

title: hakkekkyū


text:
Citations:manosphere

Noun: "(neologism) the totality of men's rights-oriented blogs and websites"

 * 2012, Bettina Arndt, "Why women lose the dating game", The Sydney Morning Herald, 22 April 2012:
 * That's when some men start behaving very badly - as the manosphere clearly shows. These internet sites are not for the faint-hearted.
 * 2012, Bilbo Poynter, "Fathers on the edge", The Gazette (Montreal), 21 July 2012:
 * Misandry is the hatred of men by women and there are dozens of websites like this one in what sometimes gets called the "manosphere," dedicated to the idea that men's' civil rights - often father's rights - are under attack by feminists and the courts.
 * 2013, Michael Kimmel, Angry White Men: American Masculinity and the End of an Era, Nation Books (2013), ISBN 9781568589640, unnumbered page:
 * The emergence of what one writer calls the “manosphere” is a loose collection of websites that sustain the rage;
 * 2013, Suzanne Moore, "The backlash against feminism aims to preserve the 'manosphere'", The Guardian, 31 July 2013:
 * They may do some childcare and fantasise about PJ O'Rourke, but they encourage the bottom-feeders of the "manosphere" who never seem to realise that feminists not only have relationships with men, but sons too.
 * 2013, Lesley Riddoch, "Male mindset still in threat mode", The Scotsman, 5 August 2013:
 * Thirty-three years later, here we are again, with prominent women sent rape threats as a way to silence and exclude them from the public world – a “so far and no further” alert delivered by the “manosphere” as it was once delivered by all powerful print media.
 * 2013, Daphna Hacker, "Men's Groups as a New Challenge to the Israeli Feminist Movement: Lessons from the Ongoing Gender War Over the Tender Years Presumption", Israel Studies, Volume 18, Number 3, Fall 2013:
 * Moreover, they promote a misogynist discourse in what is now called the "manosphere"—a web of hundreds of Internet sites, blogs, and forums devoted to slandering all women as a group.
 * 2013, Alyssa Pry & Alexa Valiente, "Women Battle Online Anti-Women Hate From the 'Manosphere'", ABC News, 16 October 2013:
 * Anita Sarkeesian, a media critic and blogger, learned this the hard way after campaigning on Kickstarter to raise funds for a web series on the roles of women in video games. The attacks from the Manosphere were swift.
 * 2014, Caitlin Dewey, "Inside the ‘manosphere’ that inspired Santa Barbara shooter Elliot Rodger", The Washington Post, May 27 2014:
 * When people talk about the “manosphere,” they’re basically talking about a vast, diverse network of blogs and forums that take a certain antagonistic stance toward women and dating. Not all branches of the manosphere are overtly appalling; not all of them are even run by men.

title: Citations:manosphere


text: subtenancies

title: subtenancies


text:
Nachtmusik

Noun

 * 1) serenade

title: Nachtmusik


text: Musikchen

title: Musikchen


text:
manosphere

Etymology
+ +, after the pattern of.

Noun

 * 1)  The domain or totality of men's-rights-oriented blogs and websites.

Derived terms

 * manospherian

Translations

 * Finnish:
 * Polish: manofsera, androsfera
 * Spanish: manosfera

title: manosphere


text: Citations:Tumblrese

title: Citations:Tumblrese


text:
flykropp

Etymology
From.

Noun

 * 1) a fuselage (main body of an aircraft)

Etymology
From.

Noun

 * 1) a fuselage (as above)

title: flykropp


text: flykroppen

title: flykroppen


text: Category:Swahili borrowed terms

title: Category:Swahili borrowed terms


text:
Talk:hutong

Water well in Mongolian
It's. --Anatoli (обсудить/вклад) 00:07, 16 January 2014 (UTC)

title: Talk:hutong


text:
牧人

Noun

 * 1) herdsman; shepherd; grazier

Noun

 * 1) herdsman, shepherd
 * 2) * 1951, 小川未明, 月と海豹:

Noun

 * 1) herdsman, shepherd

title: 牧人


text:
Talk:胡同

See Talk:hutong

title: Talk:胡同


text:
undertext

Noun

 * 1) Text situated below overlying text, such as on a palimpsest.
 * 2) * 2007, Reviel Netz & William Noel, The Archimedes Codex: How a Medieval Prayer Book is Revealing the True Genius of Antiquity's Greatest Scientist, Da Capo Press (2007), ISBN 9780786745388, unnamed page:
 * The problem is that many of the letters in the undertext of the Palimpsest cannot be read,

title: undertext


text: flykropper

title: flykropper


text:
あぜみち

Etymology
From.

Noun

 * 1) footpath or trail between rice fields

title: あぜみち


text: Category:Japanese terms spelled with 畦

title: Category:Japanese terms spelled with 畦


text: flykroppene

title: flykroppene


text:
take the law into one's own hands

Verb

 * 1)  To punish someone according to one's own idea of justice, without consideration for the role of law enforcement authorities.

Related terms

 * take matters into one's own hands

Translations

 * Catalan: fer justícia pel seu compte
 * Chinese:
 * Mandarin: 用私刑
 * Finnish: ottaa laki omiin käsiinsä, käyttää omankädenoikeutta, jakaa oman käden oikeutta
 * French: se faire justice soi-même,
 * Hebrew: לקח את החוק לידיים
 * Indonesian:
 * Italian: farsi giustizia
 * Russian:
 * Spanish: tomarse la justicia por su mano

title: take the law into one's own hands


text:
Citations:cishet

Adjective: "(informal, neologism) cissexual and heterosexual"

 * 2013, "Witchymorgan", "On the Labor Movement and Transmisogyny", Black & Pink, May 2013, page 4:
 * Even in death, the way we are spoken about by the mainstream cishet world is traumatizing and violent. Even in death, trans women of color cannot escape the trauma of colonialism and genocide.
 * 2013, Ariel Estrella, "Bringing Sexy Mac! The ins and outs of coming out", The Mac Weekly (Macalester College), 11 October 2013:
 * Coming out “of the closet” is the act of revealing your queer gender, sexual and/or romantic identity, an act made a necessity due to living in a society that assumes uniformly cisgender and heterosexual (which I will shorten to cishet) experiences. Although he wasn’t the first to advocate for it, the first openly gay American politician Harvey Milk promoted coming out as a political act because it raised visibility for a severely underrepresented group. To Milk, coming out both humanized the queer experience for cishet people and encouraged queer people to more easily build a stronger community.
 * 2013, Ariel Estrella, "Hegemony, heteronormativity and amoeba", The Mac Weekly (Macalester College), 18 October 2013:
 * While children can be born to any kind of parent and situation, unless drastic measures are taken, they will be raised in an overwhelmingly cisgendered and heterosexual (cishet) world. Cishet children and adults’ identities are affirmed by media, legal documents, population majority, history and other depictions of assumed cis-ness and heterosexuality.
 * 2013, K. A. Cook, Crooked Words: A Collection of Queer, Transgender and Womanist Writings, self-published (2013), page 87:
 * Because of some ridiculous cishet notion that all queer women must look alike?
 * 2014, Thomas Gane, "Dear society. There's no need for comment.", Bath Impact (University of Bath Students' Union), 6 January 2014, Volume 16, Issue 7, page 3:
 * Overpriviliged cishet white men were the ones enforcing apartheid in the first place, so there are far better people out there to properly comment on the issue.
 * 2014, Robin Eames, "In defence of unattractive feminism", Honi Soit (University of Sydney), Semester 1, Week 12, page 17:
 * it reinforces the problematic notion that 'true' feminism belongs to cishet white abled feminists;
 * 2014, Taylor Stocks, "Angry Feminist Rant", The Out Port, June 2014, page 8:
 * I want us all to be united in combatting the problems of cis-het norms, but I need us to acknowledge that there still is rampant sexism that is coupling with genderism that often presents as harsh and lacking reality to us female-bodied genderbenders.
 * 2014, Emma Jericho, "Not Queer As In 'Weird,' Queer As in 'F*ck You'", Orenda, Volume 1, October 2014, page 14:
 * However, when this identity is something other than cishet [cisgender/heterosexual], problems arise.
 * 2014, Maurice Broaddus, Jerry Gordon, Tom Piccirilli, Streets of Shadows (ISBN 193984021X), Page 160:
 * We picked Jason on purpose: cishet, white dude, college educated—he was even in my Urban Geographies class.

Noun: "(informal, neologism) a cissexual and heterosexual person"

 * 2013, Anonymous letter-writer quoted in Maureen Matthews, "About last night", The Sydney Morning Herald, 6 October 2013:
 * Last weekend I was on Facebook taking part in a conversation about dating sites when someone called me a cishet, in a sneering tone.

title: Citations:cishet


text: take law into one's own hands

title: take law into one's own hands


text: flykroppar

title: flykroppar


text: flykroppane

title: flykroppane


text:
授予

Verb

 * 1) to confer; to award; to grant

title: 授予


text:
Meánmhuir

Etymology
From.

Proper noun

 * 1) the Mediterranean Sea

title: Meánmhuir


text: 勳章

title: 勳章


text: 勋章

title: 勋章


text:
破冰船

Noun

 * 1) icebreaker (ship)

title: 破冰船


text:
Template talk:zh-new

@Wyang. Can you add Japanese on'yomi while you're at it? --Anatoli (обсудить/вклад) 00:41, 16 January 2014 (UTC)

 * RE: "always check the correctness of the simp-trad two-way conversion". Perhaps a suggestion to start with traditional, rather than simplified will eliminate 99% of conversion errors? Will this template handle IPA for erhua correctly or is it too hard? --Anatoli (обсудить/вклад) 00:44, 16 January 2014 (UTC)

 * 1) OK, but how should ja-kanjitab be produced? Not character-by-character, just the entire hiragana reading?
 * 2) The converter goes trad->simp, and is thus less prone to errors. However there is always the possibility of misconversions with simplified titles.
 * 3) Not currently enabled. It will require another function and should be fairly easy to do. Wyang (talk) 00:54, 16 January 2014 (UTC)

 * Re: 1) I meant this to be a manual parameter, like "on'yomi=がく|romaji=gaku", multiple reading separated by commas. Re: 3) Looking forward to the erhua function. --Anatoli (обсудить/вклад) 01:03, 16 January 2014 (UTC)

 * What about multi-character words? eg. 求婚 - きゅうこん. Should it produce or  ? What about the suru verb in that entry? Wyang (talk) 01:11, 16 January 2014 (UTC)

 * I don't exactly know the purpose of the template. That's for Mandarin entries, right? Do you intend to show Japanese, Korean and Vietnamese cognates or is this to generate entries in these languages? If the latter, then the template is not called correctly. Multi-character terms it should display in full, so for 求婚 = "on'yomi=きゅうこん|romaji=kyūkon", IMHO. I don't understand your question about "suru verbs" since I don't know exactly what you intend to do with this template. BTW, Requests_for_moves,_mergers_and_splits (pls don't get too emotional, just state your reasons there!). --Anatoli (обсудить/вклад) 01:17, 16 January 2014 (UTC)
 * Also, re: it's best to ask . --Anatoli (обсудить/вклад) 01:22, 16 January 2014 (UTC)

Parts of speech abbreviations
@User:Wyang, could you please list part of speech abbreviations the template works with. --Anatoli (обсудить/вклад) 01:14, 20 January 2014 (UTC)

 * Please see Module:zh#postitle and #poshead. You can add more to that list. Wyang (talk) 03:42, 20 January 2014 (UTC)

 * Thanks, I'll take a look. --Anatoli (обсудить/вклад) 03:52, 20 January 2014 (UTC)

Pronunciation issues and requests
I'm going to add entries to Category:Requests for pronunciation (Mandarin) when there seems to be a problem generating correct IPA, including Category:Mandarin erhua terms, such as 带儿. Something didn't work well with 教育部, I think. --Anatoli (обсудить/вклад) 01:17, 20 January 2014 (UTC)

 * Please see 带儿 and 教育部 (what do you think did not work well for the latter?). Wyang (talk) 03:42, 20 January 2014 (UTC)

 * Oh, have you fixed erhua? That would be great. In 教育部, "yù" is simply /y¹/. Is this correct? --Anatoli (обсудить/вклад) 03:51, 20 January 2014 (UTC)

 * Erhua rhymes are accepted by Pinyin-IPA tool, but I haven't started on an erhua autocreation script... Pinyin 'yu' is IPA /y/; please see . Wyang (talk) 04:10, 20 January 2014 (UTC)

 * Thanks. I'm not 100% familiar with IPA for Mandarin. So, is /tɑɻ⁵¹/ is correct for "dàir" but it may be incorrect for other erhua? Should I tag those somehow when I create erhua entries? --Anatoli (обсудить/вклад) 04:16, 20 January 2014 (UTC)

 * Nope there is no need to do that. It should be correct as long as PreviousCharacter+er is in one syllable, i.e. not "Pinyin-IPA|dài|ér" Wyang (talk) 04:21, 20 January 2014 (UTC)
 * Got it, thank you! --Anatoli (обсудить/вклад) 04:58, 20 January 2014 (UTC)

@User:Atitarev Template:cmn-new-er now done. Wyang (talk) 06:42, 20 January 2014 (UTC)

 * Thank you! I will definitely use it. I saw you using it. --Anatoli (обсудить/вклад) 11:48, 20 January 2014 (UTC)

燉
the tool failed to process this character, a traditional alternative of 炖. See 炖肉/燉肉.

CC: --Anatoli (обсудить/вклад) 00:16, 11 February 2014 (UTC)

 * Modified. Please note that simplified 炖 corresponds to traditional 燉 and 炖 (the latter is rarer but is well represented in the corpus, eg. ). Thus 炖肉 (simp) ~ 燉肉/炖肉 (trad). Wyang (talk) 00:27, 11 February 2014 (UTC)
 * Thanks. I'm aware of this, that's why I added "or" in 炖肉/燉肉. I will update 炖菜/燉菜 later. (Chinese needs categories by characters like Japanese.) --Anatoli (обсудить/вклад) 00:31, 11 February 2014 (UTC)

Postposition
. The template for postpositions is, so it should generate "post", not "postp". ( needs updating, like, so it only displays one of simp./trad., not both) --Anatoli (обсудить/вклад) 05:11, 11 February 2014 (UTC)

 * Thanks, done. As for the latter, I suggest deprecating these headword templates altogether, since all information in those templates is duplicated elsewhere in the entry (Grease pit/2014/February). Wyang (talk) 05:17, 11 February 2014 (UTC)
 * Thanks again for fixing.
 * I'm sure your suggestion to remove parts of speech for Chinese entries will not sit well with most editors. There are dictionaries that skip displaying parts of speech for Chinese, it's fine when there are example sentences but most users are just used to parts of speech and Chinese DOES have parts of speech, even if they work differently. There's no harm in duplicating and the usability is better when there are separate PoS sections. Predictable PoS don't need to be created (people tried to create verb sections for each Vietnamese, Thai or Mandarin adjectives in the past, but Vietnamese is always "beautiful" and "to be beautiful". I don't find 明白 badly structured, even if it had more PoS. It also matches the structure of other languages. There are many languages with unusual PoS. It's more scientific and correct to have them. That's my opinion but you'll have to sell your idea to the community. At the moment, I don't see it happening, though. Merging Chinese varieties is more realistic (while having separate sections for Hanzi (Interlingual)). --Anatoli (обсудить/вклад) 05:32, 11 February 2014 (UTC)

 * Multiple PoS is one thing, repeating the same information (traditional, simplified, Pinyin) in every headword template is more of what I meant above. All these have duplicates elsewhere. Wyang (talk) 05:56, 11 February 2014 (UTC)
 * I see. Which section do you suggest to move it too? Wouldn't that complicate simple words (with one PoS)? --Anatoli (обсудить/вклад) 06:11, 11 February 2014 (UTC)

 * Pinyin should go to Pronunciation (where I have adapted Template:Pinyin-IPA to make it display). Traditional and simplified are pure replicates of the Hanzi box and make maintenance harder, thus they should be removed. The rs value has long been obsoleted. Therefore the headword templates contain no novel information on their own, i.e. adds no informative data to the entry and should be reformatted. Wyang (talk) 06:15, 11 February 2014 (UTC)

 * I partially agree with you. We should phase out tra, sim and rs parameters but we should definitely keep toned Pinyin -pin, as transliteration in any headword in any language. We should also keep pint (numbered Pinyin) for sorting purposes and s, t or ts for categorisation, <tt>mw</tt> for nouns.
 * I think Pinyin should be phased out too (unless it has disambiguating functions). Duplicates are distracting and cause headaches in maintenance.
 * Current:
 * Suggested:
 * Sorting of entries should be using <tt>pint</tt>.
 * The submodule in Module:PinyinBopo-convert does pin->pint conversion. Thus pint is extraneous when pin is present.
 * Toned Pinyin in pronunciation and headwords:
 * They should be different, IMO if there is tone sandhi, capitalisation and probably hyphenation and spacing, so that nǐhǎo and Běijīng are shown as níhǎo and běijīng in the pronunciation section.
 * Tone sandhi is not reflected in Pinyin. Thus still outputs 'nǐhǎo' in Pinyin but writes tone sandhi in IPA. I can write a script to output phonetic Pinyin though, such as '/nǐhǎo/ > [níhǎo]' (although I don't think this is necessary).
 * Capitalisation and other symbols don't matter. "A-B C'D" can be made to be interpreted like "ABCD".
 * This would not be easy to achieve, though, even if there is a full agreement between Chinese speaking editors. Even a simpler issue with categorisation (...in traditional script/...in simplified script) is not actioned yet. Someone would need to write a bot. --Anatoli (обсудить/вклад) 11:27, 11 February 2014 (UTC)
 * It is very easy to do with AWB. If I have rights, I would have done that. Wyang (talk) 03:56, 12 February 2014 (UTC)
 * You have a lot of good points but I don't agree with removing Pinyin from the headword (BTW, standard Pinyin should capitalise place names, see Pinyin). We also need to include Zhuyin in the headword, automatically generated. I don't seem to have access to AWB myself and I don't know much about it. We agree on quite a few things. We should call on other Chinese speaking editors and decide what to do with Chinese headwords. Removing <tt>pint</tt>, <tt>tra</tt>, <tt>sim</tt> and <tt>rs</tt> is already a big change. We should move a portion of this discussion to BP. Hopefully, you'll get access to AWB.

 * Pinging, , , please call on anyone who I missed and might be interested. --Anatoli (обсудить/вклад) 05:29, 12 February 2014 (UTC)
 * In my opinion, the pronunciation reflecting tone sandhi should never be in the form of a bare pinyin. Moreover, I would add an entry in a hidden category if it has redundant sim or tra parameters (and additionally if it lacks both of these). Moreover, since there are many characters in Chinese, I would not recommend removing rs and automating it, unless you are going to remove all use of rs, which means that it is not going be sort by the rs. Just my opinion. --kc_kennylau (talk) 09:14, 13 February 2014 (UTC)
 * Where does it say place names should be capitalised? @Atitarev I have seen you capitalising pinyin for demographic nouns　俄罗斯人. Is this standard? I just ignored it as it's non-consequential whether it's in cap or not as far as I am concerned as long as the phonetic information is not lost in the process. Jamesjiao → T ◊ C 02:26, 14 February 2014 (UTC)
 * Guys. The main question here is not about Pinyin but about changing the headwords. Wyang suggests to remove a few parameters. Yes, Pinyin should be capitalised for place, people's names and ethnicities. A dictionary that follows these rules is Pleco. I'm okey with not showing tone sandhi in Pinyin, I was only referring to the pronunciation section. --Anatoli (обсудить/вклад) 03:31, 14 February 2014 (UTC)

New PoS
For the lack of consensus on naming, I have added a new part of speech - "counters" (i.e. classifier, measure word), for which we already have templates in other languages. See 档子. Could you add counters to the script, please? --Anatoli (обсудить/вклад) 01:28, 19 March 2014 (UTC)

 * Counter? Classifier? I think "classifier" might be more common. has "classifier" too. Wyang (talk) 03:07, 19 March 2014 (UTC)

 * The discussion about the naming for SoP didn't lead anywhere. "===Counter===" header is already approved by the autoformat, classifier is not. In any case, we can rename the template later. I'm neutral on the name but I think languages having measure words should use the same header, as there is no big difference between Japanese, Burmese, Chinese, etc. measure words. --Anatoli (обсудить/вклад) 03:24, 19 March 2014 (UTC)

 * I've added 'counter' now. Wyang (talk) 03:32, 19 March 2014 (UTC)

 * Although the English term "counter" may be used for Japanese and Korean, it is not used for Mandarin; the terms "classifier" and "measure word" are used. At this project we should always use the most commonly and widely used terms, not try to invent our own. That weakens our site's functionality and has no point. 173.89.236.187 05:01, 1 April 2014 (UTC)

 * Is ===Classifier=== allowed? See also Beer_parlour/2013/November. If we move Chinese classifiers, we have to move all others, for consistency - Category:Counters_by_language. --Anatoli (обсудить/вклад) 06:49, 1 April 2014 (UTC)

 * @173.89.236.187, the discussion is continued at Beer_parlour/2014/April. Apparently, "classifier" is also allowed at Wiktionary, so we rename counters to classifiers. Could you make the change in the template, please. Vietnamese nouns use <tt>cls=</tt> parameters in, perhaps we can adopt that as well for Chinese? I'll rename  and work on all words that using it (not a big list). Ideally we should change all nouns to use <tt>cls=</tt>, instead of the current <tt>mw=</tt> in  but the list of nouns using them might be big, I don't know how to find those. --Anatoli (обсудить/вклад) 23:46, 1 April 2014 (UTC)

Changed in template. This is the list.

馬, 马, 猫, 倉庫, 刀, 報, 山, 报, 猪, 疤, 痂, 盆, 竹, 笔, 筆, 衣, 貓, 鍾, 鐘, 钟, 飯, 饭, 魚, 鱼, 鳥, 鸟, 窗口, 字典, 电影, 蜜蜂, 眼睛, 人力車, 森林, 蚊子, 蜡笔, 成语, 日記, 乐器, 椅子, 飞机, 小说, 軍隊, 自行车, 演唱会, 香蕉, 汽车, 災難, 作家, 大学, 学校, 大學, 大陸, 大陆, 雀斑, 商品, 飛機, 汽車, 绵羊, 綿羊, 情報, 樂器, 小說, 自行車, 照片, 蟾蜍, 和服, 雪豹, 裤子, 褲子, 玫瑰, 高潮, 植物園, 電影, 細菌, 工人, 教室, 黑板, 活火山, 帽子, 钻石, 共鳴, 十二指腸, 海豹, 口紅, 骰子, 石頭, 作品, 课本, 課本, 浴衣, 季節, 半島, 學校, 紙幣, 書店, 规则, 規則, 手術, 鑽石, 蠟筆, 種族, 鱿鱼, 魷魚, 政党, 口红, 成語, 演唱會, 摩天楼, 日记, 電線, 灰鼠, 黄瓜, 黃瓜, 鐘頭, 钟头, 方針, 曲線, 曲线, 歌曲, 白领, 白領, 牦牛, 氂牛, 姿勢, 潜水艇, 订书机, 訂書機, 中提琴, 提琴, 小提琴, 大提琴, 低音提琴, 潛水艇, 米酒, 金字塔, 烏賊, 小牛, 村子, 座位, 瓜子, 距離, 木材, 休火山, 死火山, 树林, 弓箭, 橋樑, 桥梁, 書架, 風俗, 距离, 項目, 婚姻, 費用, 广场, 储藏室, 旅館, 仓库, 珍珠, 青蛙, 武装部队, 虱子, 书店, 紀念品, 教科書, 隘口, 城堡, 跑车, 生意, 白果, 灯芯草, 有机玻璃, 回归线, 狗肉, 鱼狗, 魚狗, 回歸線, 水坝, 水壩, 立法, 连衣裙, 連衣裙, 口号, 口號, 松鼠, 山脈, 争论, 工具, 夜猫子, 夜貓子, 镜子, 鏡子, 馅饼, 餡餅, 山脉, 迷你裙, 竖琴, 豎琴, 短裤, 短褲, 方针, 爭論, 手机, 手機, 色子, 斗鱼, 鬥魚, 栗鼠, 叶子, 葉子, 线索, 项目, 散文, 舞蹈设计, 舞蹈設計, 週刊, 梯子, 战争, 戰爭, 飞吻, 飛吻, 獼猴, 圣战, 曲子, 跷跷板, 蹺蹺板, 教科书, 甲骨, 国画, 盖子, 蓋子, 猕猴, 國畫, 餐巾, 皮包, 导向飞弹, 飞弹, 徽剧, 本生灯, 石头, 灰烬, 摩天大楼, 半岛, 标语, 树枝, 罚球, 罰球, 區域網路, 健身房, 钢锯, 鋼鋸, 咖啡厅, 咖啡馆, 咖啡屋, 种子, 绳子, 繩子, 移动电话, 移動電話, 手提电话, 手提電話, 摩天大樓, 大楼, 大樓, 咖啡豆, 咖啡館, 咖啡廳, 咖啡店, 咖啡室, 道德经, 吉普车, 吉普車, 吉普, 本生燈, 课堂, 課堂, 鸵鸟, 剃刀, 政黨, 电影院, 電影院, 有機玻璃, 聖戰, 宗教战争, 宗教戰爭, 安全感, 植物园, 牛轧糖, 牛軋糖, 停车场, 停車場, 勃起, 灰燼, 徽劇, 放大镜, 放大鏡, 邮件, 郵件, 導向飛彈, 导弹, 導彈, 飛彈, 内燃机, 內燃機, 藏青果, 進球, 文件, 公文, 出生证, 出生證, 休眠火山, 吸管, 吸管儿, 吸管兒, 肉铺, 肉舖, 礼品店, 禮品店, 礼品, 禮品, 图画, 圖畫, 光线, 光線, 岛屿, 島嶼, 译文, 譯文, 新闻稿, 新聞稿, 落地扇, 道德經, 火狐, 白鹳, 白鸛, 鬼火, 野火鸡, 野火雞, 文稿, 茶叶, 茶葉, 汤锅, 湯鍋, 战斗, 戰鬥, 尸体, 屍體, 台阶, 臺階, 简历, 簡歷, 报表, 報表, 费用, 航空公司, 高原, 种族, 肤色, 膚色, 分类广告, 分類廣告, 频道, 頻道, 车座, 車座, 戏剧, 戲劇, 谎话, 謊話, 笑话, 笑話, 季节, 图钉, 圖釘, 宣言, 牛仔裤, 牛仔褲, 演员, 演員, 夜总会, 夜總會, 总会, 總會, 鞋子, 脚趾, 腳趾, 脚指, 腳指, 方糖, 刺猬, 刺蝟, 价值, 價值, 燈芯草, 美剧, 美劇, 灾难, 推荐信, 推薦信, 人力车, 相片, 儀式, 仪式, 法官, 支票, 債券, 骨骼, 水母, 灰领, 灰領, 黑领, 黑領, 蓝领, 藍領, 绿领, 綠領, 粉领, 粉領, 知识工人, 知識工人, 风俗, 家庭影院, 家庭剧院, 家庭劇院, 影院, 剧院, 劇院, 廣場, 種子, 公用電話, 公用电话, 试验, 試驗, 债券, 姿势, 武裝部隊, 建议, 建議, 区域网路, 区域, 區域, 局域网, 局域網, 手册, 手冊, 软件, 軟件, 软体, 軟體, 游泳池, 发票, 發票, 村舍, 传送带, 傳送帶, 情报, 观点, 觀點, 冠军, 冠軍, 马路, 馬路, 门把, 門把, 财产, 財產, 伤疤, 傷疤, 伤痕, 傷痕, 疤痕, 香料, 公寓, 拐杖, 枴杖, 拐棍, 枴棍, 青藜, 柺棍, 柺杖, 手杖, 卡片, 合同, 烤炉, 烤爐, 款项, 款項, 影片, 军队, 丑事, 醜事, 丑闻, 醜聞, 长牙, 長牙, 售票处, 售票處, 气候, 氣候, 热水瓶, 熱水瓶, 棉衣, 旗子, 手帕, 手套, 手术, 瓶子, 花灯, 花燈, 不足之处, 不足之處, 纸飞机, 紙飛機, 胳膊, 胳臂, 罐头, 罐頭, 纪念, 紀念, 纪念品, 实验室, 實驗室, 海关, 海關, 旅馆, 书架, 书橱, 書櫥, 书挡, 書擋, 灾害, 災害, 罚款, 罰款, 鲜花, 鮮花, 细菌, 红绿灯, 紅綠燈, 球场, 球場, 裙子, 岛国, 圣经, 聖經, 集体, 集體, 录音机, 錄音機, 例子, 盘子, 盤子, 牙刷, 画报, 畫報, 筒仓, 筒倉, 粮仓, 糧倉, 屋顶, 屋頂, 雨衣, 勺子, 海蜇, 木头, 木頭, 木料, 木柴, 柴火, 试卷, 試卷, 建筑, 建築, 建筑物, 建築物, 胸罩, 监狱, 監獄, 研究所, 阶段, 階段, 竞赛, 競賽, 粉笔, 粉筆, 島國, 米仓, 米倉, 刀叉, 党证, 黨證, 手术室, 手術室, 黄色小说, 黃色小說, 海龟, 海龜, 河蟹, 幸事, 工艺品, 工藝品, 工艺, 工藝, 鴕鳥, 蚂蚁, 螞蟻, 食蚁兽, 食蟻獸, 周刊, 信天翁, 犰狳, 乌鸫, 烏鶇, 乌贼, 喜鹊, 喜鵲, 路考, 大猩猩, 猩猩, 复印件, 複印件, 阅览室, 閱覽室, 黑猩猩, 儲藏室, 睡衣, 山羊, 订书钉, 訂書釘, 纱笼, 紗籠, 冬瓜, 食单, 食單, 菜单, 菜單, 拉链, 拉鏈, 共鸣, 校服, 癞蛤蟆, 癩蛤蟆, 电视剧, 電視劇, 连续剧, 連續劇, 尿布, 蟑螂, 贷款, 貸款, 旱灾, 旱災, 股票, 村庄, 村莊, 剑齿虎, 劍齒虎, 背心, 茶馆, 茶館, 电线, 標語, 热气, 熱氣, 面孔, 进步, 進步, 皱纹, 皺紋, 水泡, 钢丝绳, 鋼絲繩, 公费, 公費, 白兔, 小兔, 小兔子, 发动机, 發動機, 收入, 摩天樓, 信用卡, 情书, 情書, 手镯, 手鐲, 镯子, 鐲子, 鸟巢, 鳥巢, 酒窖, 汗腺, 铁路, 鐵路, 匕首, 菜譜, 菜谱, 笔记本, 筆記本, 烟囱, 煙囪, 十二指肠, 潜艇, 潛艇, 年头, 年頭, 毯子, 收音机, 收音機, 梳子, 联防员, 聯防員, 硬幣, 硬币, 纸币, 专业, 專業, 鸭子, 鴨子, 进球, 跑車, 亭子, 童年, 拖拉机, 拖拉機, 皺紋兒, 皱纹儿, 奶罩, 出生證明書, 出生证明书, 期刊, 肥肉, 果肉, 水井, 堅果, 坚果.

I have found that use of the classifier parameter without any comments can possibly be very misleading, as in reality multiple classifiers are often in use, with different purposes. Wyang (talk) 03:26, 2 April 2014 (UTC)

 * Ah, that's a big list. I meant the existing small list, though - Category:Mandarin counters. Of course, new ones can and should be created, especially common and useful. As for the different purpose of classifiers, too ambiguous can be left out, we can up to three parameters and comments can always be added but Chinese learners like it when classifiers are available for nouns (they are optional, of course). --Anatoli (обсудить/вклад) 03:50, 2 April 2014 (UTC)

 * OK, I have moved Mandarin, Vietnamese, Korean and Bengali counters to classifiers. I need to do it for Japanese but I may need help with these. --Anatoli (обсудить/вклад) 05:59, 3 April 2014 (UTC)
 * The discussion has only ever been about Chinese, and only to deal with the problem of "Measure word" being considered non-standard. Changing anything in the other languages without consulting the contributors who work with those languages is simply unacceptable. Don't do it! Chuck Entz (talk) 13:34, 3 April 2014 (UTC)

Capitalisation of proper nouns
Can "propn" be automatically capitalised in the header (not pronunciation) - the first word only? Also the types 21, 12, should probably expanded to allow longer words. --Anatoli (обсудить/вклад) 01:29, 21 March 2014 (UTC)

 * Thanks, propn fixed. Currently enabled types: 12 21 22 23 32 31 13 41 14 111 211 112 121 221 212 122 1111. Wyang (talk) 01:46, 21 March 2014 (UTC)

 * Thanks, would longer words like this work: 美利堅合眾國 (or longer) to give 美利堅 + 合眾國? --Anatoli (обсудить/вклад) 01:55, 21 March 2014 (UTC)

 * 苏维埃社会主义共和国联盟 must be too hard to chew for the template/module :) --Anatoli (обсудить/вклад) 02:13, 21 March 2014 (UTC)

 * OK... try pn there now. Wyang (talk) 03:23, 21 March 2014 (UTC)
 * Brilliant, thank you! --Anatoli (обсудить/вклад) 03:25, 21 March 2014 (UTC)

New PoS2
I've just added another part of speech - suffix, see,. Please add to the templates. --Anatoli (обсудить/вклад) 07:52, 21 April 2014 (UTC)
 * Sorry for the delay. I was on holiday for the past few days. Now included. Wyang (talk) 08:13, 22 April 2014 (UTC)
 * Thanks for this and other recent edits! --Anatoli (обсудить/вклад) 08:37, 22 April 2014 (UTC)

Module error
something seems to be broken but I don't get an error message. --Anatoli (обсудить/вклад) 12:16, 23 April 2014 (UTC)

 * On what page did the error happen? Wyang (talk) 12:30, 23 April 2014 (UTC)

 * Anywhere I tried, e.g. 爱知 with propn --Anatoli (обсудить/вклад) 12:52, 23 April 2014 (UTC)
 * It actually shows the error message 爱知 in the edit mode. --Anatoli (обсудить/вклад) 12:57, 23 April 2014 (UTC)
 * Also calling it might be something to do with some changes to Module:zh? Error message: "Lua error in Module:zh at line 170: attempt to call method 'ucfirst' (a nil value)". I'm going to bed soon, sorry to bring you guys bad news :( --Anatoli (обсудить/вклад) 13:09, 23 April 2014 (UTC)
 * Fixed. --kc_kennylau (talk) 13:22, 23 April 2014 (UTC)
 * Thanks! Minor thing - capitalisation is lost for proper nouns (first Pinyin word) --Anatoli (обсудить/вклад) 13:37, 23 April 2014 (UTC)
 * I'm fixing it, but in cases like 致富, should the capitalized version or the non-capitalized version be displayed in the pronunciation section? --kc_kennylau (talk) 14:50, 23 April 2014 (UTC)
 * Fixed. --kc_kennylau (talk) 14:56, 23 April 2014 (UTC)
 * Thank you. I'm neutral on this (pronunciation section). Also, a linguistic question - are demonyms like 中国人, 俄罗斯人 and language names - proper nouns and should be capitalised? I said previously yes, according to Pleco but having second thoughts and we may have difficulty implementing this consistently (CC: we had a discussion on that). --Anatoli (обсудить/вклад) 23:04, 23 April 2014 (UTC)
 * I've always been against the idea of capitalising pinyin at all. Pinyin is a transcription system, so it shouldn't carry any semantic or grammatical information. However, people here seem to agree on capitalsing pinyin for proper nouns. I have acquiesced to that, but capitalising demonyms doesn't seem to make any sense. Jamesjiao → T ◊ C 23:30, 27 April 2014 (UTC)
 * Well, capitalisation of place and people's names are generally accepted in pinyin - Wikipedia has a rule about, so do most dictionaries. Now that Wyang's wonderful tool automatically capitalises proper nouns and Japanese modules do the same, I thought about this inconsistency. Pleco and Wenlin do capitalise languages and demonym, I think just following - China->Chinese, Japan->Japanese, etc. If we decide that languages and demonyms are NOT proper nouns in Chinese, then we can convert them to lower case (it's already done so with Japanese). --Anatoli (обсудить/вклад) 23:51, 27 April 2014 (UTC)
 * (oversimplified? ;)), new woes: 戰壕, User_talk:Wyang. CC  --Anatoli (обсудить/вклад) 23:23, 23 April 2014 (UTC)

 * I have restored the last functioning version. Please make sure your changes do not break the module. Maybe use your userpage modules for experimentation of significant changes. Wyang (talk) 23:32, 23 April 2014 (UTC)

 * (E/C)Thanks, Wyang. Kc kennylau, please don't consider it a harsh criticism, you're allowed to try. Maybe we should now use trial versions? Module:zh has become too important and people are relying on it. Wyang, you beat me to it. :)--Anatoli (обсудить/вклад) 23:34, 23 April 2014 (UTC)

 * Still does it 栃木. --Anatoli (обсудить/вклад) 00:04, 24 April 2014 (UTC)

 * I have restored an earlier version which seems to non-broken. Wyang (talk) 00:13, 24 April 2014 (UTC)
 * I apologize for all the mess I've created. I've fixed it now. --kc_kennylau (talk) 00:54, 24 April 2014 (UTC)

Co-creation - Vietnamese, Korean
Is this feature gone? I tried to add a Vietnamese Hán tự entry using pn on 神戶. --Anatoli (обсудить/вклад) 07:33, 25 April 2014 (UTC)
 * The parameter name is vi instead of v. --kc_kennylau (talk) 07:47, 25 April 2014 (UTC)
 * I have tried that as well... --Anatoli (обсудить/вклад) 07:49, 25 April 2014 (UTC)
 * Sorry, the paremeter is v and I've fixed it now. --kc_kennylau (talk) 07:55, 25 April 2014 (UTC)

Module error" does not exist.-->
Not working again on pn on 長野. --Anatoli (обсудить/вклад) 11:59, 25 April 2014 (UTC) Module error" does not exist.-->
 * The error message is above. --Anatoli (обсудить/вклад) 12:01, 25 April 2014 (UTC)

 * , could you make User:Kc kennylau/Module:zh and copy of templates, which use it for your testing? I'd like to use Module:zh but it's not working. --Anatoli (обсудить/вклад) 12:24, 25 April 2014 (UTC)
 * I previewed each time I edit Module:zh... As you can see, the template read the function as create which should have been commented out. This is a bug of the whole MediaWiki itself, and I will report this to the Beer Parlour Grease Pit. (Actually part of this is my fault too, as I have edited the main template without testing.) Fixed. --kc_kennylau (talk) 15:05, 25 April 2014 (UTC)
 * The bug cannot be reproduced... --kc_kennylau (talk) 15:13, 25 April 2014 (UTC)
 * Reproduction successful, reported. --kc_kennylau (talk) 15:24, 25 April 2014 (UTC)

Topolect parameters
I see you have changed the template. Are you able to add 'c', 'mn' and 'w' parameters for pronunciations? (yue, nan and wuu are standard codes for Cantonese, Min Nan and Wu, actually).

Shall I move it to with a redirect?

I wonder if it's hard to recreate/create all zh Categories - exactly as Category:cmn:All topics with "zh" code, minus "... in simplified script"/"... in traditional script"? --Anatoli (обсудить/вклад) 00:09, 2 May 2014 (UTC)

 * Don't forget do bring across "homophones" to, see 祕密 --Anatoli (обсудить/вклад) 00:18, 2 May 2014 (UTC)

 * You speak my mind! I have done 1 (Template:zh-new/documentation), 2 (Template:zh-new), 3 (Category:zh:List of topics, Special:Contributions/Wyangbot), and 4 (秘密). Wyang (talk) 01:22, 2 May 2014 (UTC)

 * Great stuff! Now, there's a lot of manual work to do... --Anatoli (обсудить/вклад) 01:42, 2 May 2014 (UTC)

 * @ 茶 there was a referenced Hakka section. I've added "hak=tshâ" to pronunciation template. Could you add Hakka handling (even if it's just translit)? Perhaps a simple one-liner could be useful for any other transliterated Chinese topolects we may come across. --Anatoli (обсудить/вклад) 01:56, 2 May 2014 (UTC)

 * Hakka dictionary

 * For Hakka I think it might be better to preserve all original information in (replace all '|' with ';'), since the parameter values are not interconvertable (eg. 人). I have added romanisations for Hakka. Please see 茶 now. Wyang (talk) 02:44, 2 May 2014 (UTC)

 * Thanks, I think I got it. Should Hakka romanisations "tshâ " really be hyperlinked? Pinyin chá should be hyperlinked in both views. And if Hakka (or any other) is present, could you add it to the "collapsed" display? --Anatoli (обсудить/вклад) 02:53, 2 May 2014 (UTC)

 * I have removed the hyperlink and added it to the top section of the template. Wyang (talk) 04:40, 2 May 2014 (UTC)

Synonyms
Synonnyms (syn) are now missing. --Anatoli (обсудить/вклад) 04:56, 2 May 2014 (UTC)
 * Pinging Kenny. Wyang (talk) 05:24, 2 May 2014 (UTC)
 * Yes, Kenny, please stop oversimplifying. Otherwise, I will have to protect it :) --Anatoli (обсудить/вклад) 05:42, 2 May 2014 (UTC)
 * Sorry, I will be more careful next time. I'll have to admit that I make mistakes often, but I'll fix them all. Fixed. --kc_kennylau (talk) 09:30, 2 May 2014 (UTC)

Small change request
Can the Korean co-created section now go below Chinese, instead of above? And can synonyms, etc. use, not by default? I hope it's not hard. --Anatoli (обсудить/вклад) 04:45, 8 May 2014 (UTC)
 * Both are done now. Wyang (talk) 04:57, 8 May 2014 (UTC)
 * Thank you! Can I have chips with that? :) On my wish list are also contexts and categories with sorting -, [ [ :Category:zh:Fruits | pin1yin1 ] ] --Anatoli (обсудить/вклад) 05:05, 8 May 2014 (UTC)
 * Second chips done. I can't do the first because it is not in Module:zh (unless I misunderstood). It doesn't seem necessary because we could write a pseudo-transliteration module and tell Module:languages/data2 to sort context tags using the stored pronunciations if there is no given sorting and if the string contains Chinese characters. Wyang (talk) 05:15, 8 May 2014 (UTC)
 * Thank you!The sorting was Zhuyin, though :) --Anatoli (обсудить/вклад) 05:29, 8 May 2014 (UTC)

 * Audio makes entries get into "Language code missing/audio cat", it needs "lang=". --Anatoli (обсудить/вклад) 05:31, 8 May 2014 (UTC)
 * Haha that was silly. Both are done. Wyang (talk) 05:35, 8 May 2014 (UTC)

Hakka, alternative forms; ko/vi
Frank, could you add POJ Hakka (h=poj) and alternative forms, please? Also, could you remove Han characters from generated hanja-tab (ko) and hantu-tab (vi)? It's easier to copy-paste without them and they are not necessary. --Anatoli (обсудить/вклад) 06:31, 20 May 2014 (UTC)
 * Hakka done; alternative forms are 'alt', 'alt2', 'alt3'; Han characters removed. Wyang (talk) 07:35, 20 May 2014 (UTC)

Category:Chinese terms with uncreated forms
Using zh-new seems to make a page appear in Category:Chinese terms with uncreated forms, regardless of whether the simplified/traditional has been created, or even if it doesn't have one (like 小小). Except, the category doesn't appear at the bottom of the word entry, and the entry disappears from the category page after a null edit. —umbreon 126 03:28, 7 April 2015 (UTC)

Some possible defects
Hi Frank,

There are possibly some defects in the template, if it's OK:

 * 1) Parameter |e= doesn't seem to work. I tried on  with e=.
 * p2, p3, etc. definitely don't work. They all think it's "p1". You can't change pinyin if it's not the first syllable. E.g. in

Thanks in advance! --Anatoli T. (обсудить/вклад) 08:43, 7 September 2016 (UTC)

 * Yeah, I have noticed this too. Perhaps could help here? I'm not sure I can understand the new lua feature in Module:zh. For #2, I have been previewing the page and using the |m= parameter instead as a workaround. Wyang (talk) 08:55, 7 September 2016 (UTC)

 * Thanks. Using |m= is a good suggestion. Hopefully Kenny can fix the |e= param. --Anatoli T. (обсудить/вклад) 09:09, 7 September 2016 (UTC)

 * Sorry for the inconvenience caused. I have fixed both issues. --kc_kennylau (talk) 12:31, 7 September 2016 (UTC)

 * Thanks Kenny! Wyang (talk) 12:33, 7 September 2016 (UTC)
 * Thanks Kenny! --Anatoli T. (обсудить/вклад) 13:21, 7 September 2016 (UTC)

A Dungan (dg) parameter?

 * Hello.

Can a Dungan parameter be created, please? For example, in the entry for I want to add :

Sorry, if you get annoyed by the group ping! Module:workgroup_ping/data--Anatoli T. (обсудить/вклад) 13:00, 9 March 2018 (UTC)

 * : It seems to work already. Justin has before. Wyang (talk) 13:08, 9 March 2018 (UTC)

 * Thanks. Now it's working, it wasn't when I tried earlier. --Anatoli T. (обсудить/вклад) 13:14, 9 March 2018 (UTC)

Xiehouyu
I wonder if the module can be modified to create new xiehouyu entries. The dog2 (talk) 15:31, 17 September 2020 (UTC)

title: Template talk:zh-new


text: 图标

title: 图标


text:
圖標

Noun

 * 1)  icon (on computers)

title: 圖標


text:
冰咖啡

Noun

 * 1) iced coffee

title: 冰咖啡


text:
雪糕

Noun

 * 1)  ice cream popsicle
 * 2)  ice cream
 * 3)  white rice cake
 * 4) * 1690, 譯語類解
 * "ko"

- 雪餻○셜교

title: 雪糕


text:
冰糕

Noun

 * 1) ice cream
 * 2) popsicle
 * 3) sorbet

Synonyms

title: 冰糕


text: túbiāo

title: túbiāo


text:
勛章

Noun

 * 1) medal; decoration; order

title: 勛章


text: 识别

title: 识别


text:
獎章

Noun

 * 1) medal; decoration

title: 獎章


text: 奖章

title: 奖章


text:
Reconstruction:Proto-Slavic/měxъ

Etymology
From, from. Cognate with 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬, 🇨🇬.

Noun

 * 1)  leather bag

Descendants

 * East Slavic:
 * South Slavic:
 * Latin: ,
 * West Slavic:
 * Sorbian:
 * South Slavic:
 * Latin: ,
 * West Slavic:
 * Sorbian:
 * Latin: ,
 * West Slavic:
 * Sorbian:
 * Latin: ,
 * West Slavic:
 * Sorbian:
 * West Slavic:
 * Sorbian:
 * Sorbian:
 * Sorbian:
 * Sorbian:
 * Sorbian:
 * Sorbian:
 * Sorbian:

title: Reconstruction:Proto-Slavic/měxъ


text:
乞求

Verb

 * 1) to beg; to implore; to beseech

title: 乞求


text:
傻子

Noun

 * 1) stupid person; simpleton; fool; idiot

title: 傻子


text:
Citations:区別

 * "ja"
 * "ja"

- また下等の中小姓と足軽との間にも甚しき区別あれども、足軽が小役人に立身してまた中小姓と為るは甚だ易し.

 * "ja"
 * "ja"

- 元より羊は草にひとしく、海ほおずきは蛙と同じサ、動植物無区別論に極ッてるよ.

 * "ja"
 * "ja"

- 政治上の論派を区別するもまたこれに似たるものあり、民権を主張するもの豈にことごとく調和論派ならんや、王権を弁護するもの豈にことごとく専制論派ならんや、ただその論拠の如何を顧みるのみ.

 * "ja"
 * "ja"

- 究竟するに善悪正邪の区別は人間の内部の生命を離れて立つこと能はず、内部の自覚と言ひ、内部の経験と言ひ、一々其名を異にすと雖、要するに根本の生命を指して言ふに外ならざるなり.

 * "ja"
 * "ja"

- 自分の職務上病傷兵を救護するには、敵だの、味方だの、日本だの、清国だのといふ、左様な名称も区別もないです.

 * "ja"
 * "ja"

- 後で考えるに、人の活々した顔を、仮面ではあるまいかなどと疑うは余り馬鹿げて居る、勿論仮面ではない、血と肉と筋と皮とで天然に育った当り前の顔である、余とても必ずしも疑ったと云う程ではない、唯殆ど仮面かとも思われる程に美しいと斯う思った迄の事さ、決して若しや仮面ではなかろうかと探偵が罪人を疑うように疑った訳ではない、断じてない、茲の区別は読者に呑み込んで貰わねばならぬ.

 * "ja"
 * "ja"

- まだ雑報と美文の区別を知らない人が大変多いやうである.

 * "ja"
 * "ja"

- ただ、大体の上につきて二者の区別を立てておく.

 * "ja"
 * "ja"

- それに、艫寄の半分を板戸で仕切つて、荷積みの為に区別がしてあるので、客の座るところは細長い座敷を見るやう.

 * "ja"
 * "ja"

- 宿にしたのは、以前一番懇意にした大工の兼さんの家であつたが、其夜は誰彼の区別なく其｜家を見舞つたので、奥の六畳間に三分心の洋燈は暗かつたが、入交り立交りする人の数は少くなく、潮の様な虫の音も聞えぬ程、賑かな話声が、十一時過ぐるまでも戸外に洩れた.

 * "ja"
 * "ja"

- 盃を納るなり汽車に乗つて家を出た夫婦の身体は、人間だか蝶だか区別が附かない.

 * "ja"
 * "ja"

- その都度御米は真丸な縁の焼けた銀の月と、絹地からほとんど区別できないような穂芒の色を眺めて、こんなものを珍重する人の気が知れないと云うような見えをした.

 * "ja"
 * "ja"

- ソクラテスを読んで、一番に面白く思うところは、かのダイモンというものを常に信じて、絶えず、自分の心の中に、善悪邪正を区別する、我にあらざる一種の力を蔵している.

 * "ja"
 * "ja"

- 既に形式的に出来上っているところの主義の為めの作物、主義の為めの批評と云うものは、虚心平気で、自己対自然の時に感じた真面目な感じとは是非区別されるものと思う.

 * "ja"
 * "ja"

- 先ず「貞操」という言葉の意味について自分の考を述べると、これには処女としての貞操と、妻としての貞操と二つの区別があるように思われる.

 * "ja"
 * "ja"

- というわけは、御料からの収入で支弁さるべきものと武家から差上ぐる御用脚で支弁さるべき分とその間おのずから区別があって、もし武家からの差上金が滞うる場合には、それがためにそれによって支弁さるべき儀式を見合わせられるので、必ずしもこれをもって官帑全くむなしかったためのみということができぬからである.

 * "ja"
 * "ja"

- 南町は、事実、木津西浜町・木津北島町並びに、木津勘助町・木津三島町の一部になつて、呼び名の上では、区別はなくなつてゐるのである.

 * "ja"
 * "ja"

- 宗教の立場から云えば、現世的な法律的な区別は、どうでもいいのでしょうが、国家の司法当局が、その現世的な職務を忘れ、『加害者を天国に送る』事を奨励し、讃美するに至っては、私の如き被害者の遺族は、憤懣に堪えないのであります.

 * "ja"
 * "ja"

- 「仕止めたか、仕止めないか、その位な区別は子供にもわかる.

 * "ja"
 * "ja"

- このような区別はどこから来たものであろうか.

 * "ja"
 * "ja"

- 私どもの住んでいた小屋は藩から立てられたもので、勤番小屋、常府小屋に区別され各役相応の等差があった.

 * "ja"
 * "ja"

- 天才色とでもいふ白い皮膚が、少しの酒ですぐ薄紅くなつて、好きだとなつたら男女の区別なくしなだれかゝらずにはゐられない、そんな人懐こひ匂ひがその心からも体からも蒸れ出るやうに見えた.

 * "ja"
 * "ja"

- おなじ東京の名をよぶにも、今後はおそらく旧東京と新東京とに区別されるであろう.

 * "ja"
 * "ja"

- 毎月十一日を期日として別に誰派の区別もなく自分の好いたままに一点でも二点でも作品を持ち寄つてそれを陳べて互ひに見合つたものです.

 * "ja"
 * "ja"

- ところが、彼は、ブルジョアが、彼と自分とを区別してるとすっかり同じように、彼とセーラーらとを区別していた.

 * "ja"
 * "ja"

- そして彼女の腹違いの妹のシルヴィが、生粋のパリの市民で――プロレタリアートで、イリュージョンを持たず、機智的で実務家で、恋愛と結婚とをはっきり区別し、「そりゃ恋人には危っかしくたって面白い人がいいけど、良人には、一寸退屈だって永持ちのする確りした人でなくっちゃ」と云う女なのに反し、アンネットは理想家です.

 * "ja"
 * "ja"

- 之等の句は、もはや男女の区別なき写生の技で光っている.

 * "ja"
 * "ja"

- この運動が他から区別されねばならない根本的な特徴は何処にあるか.

 * "ja"
 * "ja"

- 清河が集めた浪士と申したところが、やはり浪士・浪人の区別はないので、百姓もあれば神主もあり、博奕打もある.

 * "ja"
 * "ja"

- そしてそれを区別すべく、前者をイノシシ、後者をカノシシと呼んだのであったが、今日ではカノシシの称呼は普通に失われて、イノシシの方のみが各地に保存されている状態である.

 * "ja"
 * "ja"

- それも何を見たとハッキリ言うことが出来ないが、役者の顔がだんだん変槓のものになって、五官の働きがあるのだか、ないのだか、何もかも一緒くたになって区別がつかなかった.

 * "ja"
 * "ja"

- 箱入の新刊書のときにはどれもこれも同じように見えたものがここでは既にその間に区別ができている.

 * "ja"
 * "ja"

- 鰊乗網中は風浪の危険を犯し、昼夜の区別なく最大労務に服すべきこと.

 * "ja"
 * "ja"

- 今はたしかに明るい昼だ、しかし、はたしてほんとにこれが昼だろうか、これが光のある昼だろうか、これは夜ではないだろうか、これがほんとに昼だとしたら、夜というものはどこにあるのだろう、昼と夜とを区別して考える人間の習慣ははたして真実のものだろうか、夜というものは、この明るい何でも見える昼の底に沈んで同時にあるのではあるまいか……そんなことを考えたりするのだった.

 * "ja"
 * "ja"

- そのうち、個人あって経験あるにあらず、経験あって個人あるのである、個人的区別より経験が根本的であるという考から独我論を脱することができ、また経験を能動的と考うることに由ってフィヒテ以後の超越哲学とも調和し得るかのように考え、遂にこの書の第二編を書いたのであるが、その不完全なることはいうまでもない.

 * "ja"
 * "ja"

- この作品なぞもヒントばかりで捉へどころが浅いと思ふだらうが、この浅いと思ふところに限りなき深さがあるのが韻文で、散文にばかり没頭してゐるとその深さが判らなくなつて仕舞ふ、一口に言へば韻文は散文のやうに言はんとすることを細大漏さず言ひつくし、思ふことを細々と並べつくすものではない、そこに韻文と散文の違ひは区別される、くどいやうだが和歌は韻文であり、詩も韻文である.

 * "ja"
 * "ja"

- 「そこが一寸不審に思われるんですが、何しろ卓一という男は、他人のものと自分のものを区別しないというような男で、何事も行き当りばったり、気分の動くまゝにやるという人間ですから、他人といっても信造の別荘ですし、締り位破って這入るのは平気だろうと思います.

 * "ja"
 * "ja"

- そこはハツキリ区別してゐないといけない.

 * "ja"
 * "ja"

- 同時に大した変り方である！　吾々は暦の上で立春だの立秋だのいふ区別をして、それを紙片にはつきり判るやうに印刷してゐる.

 * "ja"
 * "ja"

- 持たざる国と持てる国の区別がなくなり、必要なものは何でもできることになるのです.

 * "ja"
 * "ja"

- 高さはないし、横、縦の区別がなく、ただ長さだけがある世界.

 * "ja"
 * "ja"

- 男であるのか、女であるのか、殆ど区別もつかない程、顔がくちやくちやに腫れ上つて、随つて眼は糸のやうに細まり、唇は思ひきり爛れ、それに、痛々しい肢体を露出させ、虫の息で彼等は横はつてゐるのであつた.

 * "ja"
 * "ja"

- 女給と分って、三人組を見直し、お客と比較してみても、やっぱり区別が分らない.

 * "ja"
 * "ja"

- と、この二つの言葉の、はつきりした区別にすぎなかつた.

 * "ja"
 * "ja"

- 肝要なこととそうでないこととの、区別がつかなかったかとさえ思われます.

 * "ja"
 * "ja"

- ほんとうに落語の「近江八景」のあの職人じゃないが、その時の私は島原にもＳ太夫が二人あって甲乙に区別されており、私のは甲、今度正蔵君の買ったのは乙だったらよかったにと大真面目にそう考えずにはいられなくなったくらいだった.

 * "ja"
 * "ja"

- 始めて耳にしたその言葉が面白く、又「上手物」に対して用いると、何かはっきりした性質の区別も示されるので、之が縁となり、私達もこの言葉を用いることに便利を感じた.

 * "ja"
 * "ja"

- におけるカフカと、この二つの流れを区別しなければならない、という.

title: Citations:区別


text: 乱伦

title: 乱伦


text:
亂倫

Verb

 * 1) to violate moral laws; to be immoral
 * 2)  to commit incest

title: 亂倫


text:
baluwerk

Etymology
From. Equivalent to. Cognate with 🇨🇬.

Noun

 * 1) evil deed

title: baluwerk


text: Category:Old Saxon terms prefixed with balu-


text: 门牙

title: 门牙


text:
門牙

Noun

 * 1) incisor

title: 門牙


text:
優柔寡斷

Idiom

 * 1) indecisive, irresolute; indecisiveness

title: 優柔寡斷


text: 优柔寡断

title: 优柔寡断


text:
waldad

Etymology
From.

Noun

 * 1) a murder, crime, murderous deed

title: waldad


text:
Meánmhara

Adjective

 * 1) Mediterranean

title: Meánmhara


text:
贓物

Noun

 * 1) stolen goods; booty; spoils
 * 2) bribe

title: 贓物


text: 赃物

title: 赃物


text:
Meánmhuirí

Etymology
From.

Adjective

 * 1) Mediterranean

title: Meánmhuirí


text: Category:Old Saxon terms prefixed with wal-


text: zāngwù

title: zāngwù


text:
裝飾品

Noun

 * 1) ornament; decoration

title: 裝飾品


text: 装饰品

title: 装饰品


text:
wal-

Root

 * 1) related to spreading or flowing over a surface

Root

 * 1)  related to negation (there is not; be without, have not)

Usage notes

 * Possibly other varieties of Fula
 * Possibly other varieties of Fula
 * Possibly other varieties of Fula
 * Possibly other varieties of Fula

Root

 * 1)  related to representation (of bride or bridegroom) in connection with a marriage contract

Prefix

 * 1) Prefix denoting death, slaughter, crime; wretched
 * waldād "a murder"

title: wal-


text:
balu-

Etymology
From.

Prefix

 * 1) mal-, mis-, badly, evily

title: balu-


text:
落地窗

Noun

 * 1) French window

title: 落地窗


text:
baludad

Etymology
From. Compare Old English bealudǣd.

Noun

 * 1) evil deed

title: baludad


text:
代價

Noun

 * 1)  price; cost; expense

title: 代價


text: 代价

title: 代价


text: dàijià

title: dàijià


text: Citations:Aspiedom

title: Citations:Aspiedom


text:
megin-

Etymology
From 🇨🇬 megin "strong". Akin to Old English mægen-.

Prefix

 * 1) Prefix denoting something strong, huge, impressive, heavy, great, powerful
 * meginfard "great expedition"
 * meginfolk "huge troop"
 * meginkraft "great power"
 * meginstrengi "strong power"
 * meginsundia "heavy sin"
 * meginthioda "big troop"
 * meginthiof "great thief, robber"

title: megin-


text:
Aspiedom

Noun

 * 1) The state or quality of being an Aspie.

title: Aspiedom


text:
armillatus

Etymology
From +.

Adjective

 * 1) Ornamented with a bracelet.

title: armillatus


text: armillata

title: armillata


text: allofams

title: allofams