Module:niv-sortkey: Difference between revisions
Jump to navigation
Jump to search
m Protected "Module:niv-sortkey": (bot) automatically protect highly visible templates/modules (reference score: 1080+ >= 1000) ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)) |
m 1 revision imported |
(No difference)
| |
Latest revision as of 12:00, 21 April 2026
Lua error in package.lua at line 80: module 'Module:languages/bySortkeyModule' not found.
local export = {}
local u = mw.ustring.char
local a, b, c = u(0xF000), u(0xF001), u(0xF002)
local oneChar = {
["ӷ"] = "г" .. a, ["ғ"] = "г" .. b, ["ӻ"] = "г" .. c, ["ё"] = "е" .. a, ["ӄ"] = "к" .. b, ["ӈ"] = "н" .. a, ["ў"] = "у" .. a, ["ӽ"] = "х" .. a, ["ӿ"] = "х" .. b
}
local twoChars = {
["кʼ"] = "к" .. a, ["ӄʼ"] = "к" .. c, ["пʼ"] = "п" .. a, ["р̌"] = "р" .. a, ["тʼ"] = "т" .. 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(mw.ustring.gsub(text, ".", oneChar))
end
return export