มอดูล:bin-sortkey
หน้าตา
- This มอดูล 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 b = u(0xF001)
local monographs = {
["ẹ"] = "e" .. a, ["ọ"] = "o" .. a
}
local digraphs = {
["gb"] = "g" .. a, ["gh"] = "g" .. b, ["kh"] = "k" .. a, ["kp"] = "k" .. b, ["mw"] = "m" .. a, ["nw"] = "n" .. a, ["ny"] = "n" .. b, ["rh"] = "r" .. a, ["rr"] = "r" .. a, ["vb"] = "v" .. a
}
function export.makeSortKey(text, lang, sc)
for from, to in pairs(digraphs) do
text = mw.ustring.gsub(text, from, to)
end
for from, to in pairs(monographs) do
text = mw.ustring.gsub(text, from, to)
end
return text
end
return export