Jump to content

Module:Unihan pronunciation

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Northern Moonlight (talk | contribs) at 00:20, 3 January 2025. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
local unicode_data = require("Module:Unicode data/sandbox")

--- @param text string
function p.kCantonese(frame)
	local text = frame.args[1]
    local result = {}
    for char in mw.text.gsplit(text, "", true) do
        local code = mw.ustring.codepoint(char)
        table.insert(result, unicode_data.lookup_kCantonese(code))
    end
    return table.concat(result, " ")
end

return p