Module:nup-sortkey
Jump to navigation
Jump to search
- This module lacks a documentation subpage. Please create it.
- Useful links: subpage list • links • transclusions • testcases • sandbox
local export = {}
local u = mw.ustring.char
local a = u(0xF000)
local twoChars = {
["dz"] = "d" .. a, ["gb"] = "g" .. a, ["kp"] = "k" .. a, ["sh"] = "s" .. a, ["ts"] = "t" .. a, ["zh"] = "z" .. a
}
function export.makeSortKey(text, lang, sc)
text = mw.ustring.lower(text)
for from, to in pairs(twoChars) do
text = mw.ustring.gsub(text, from, to)
end
return mw.ustring.upper(text)
end
return export