Jump to content

Module:sms-sortkey

Wiktionary වෙතින්


local export = {}
local u = mw.ustring.char
local a, b, c = u(0xF000), u(0xF001), u(0xF002)

local oneChar = {
	["â"] = "a" .. a, ["č"] = "c" .. a, ["ʒ"] = "c" .. b, ["ǯ"] = "c" .. c, ["đ"] = "d" .. a, ["ǧ"] = "g" .. a, ["ǥ"] = "g" .. b, ["ǩ"] = "k" .. a, ["ŋ"] = "n" .. a, ["õ"] = "o" .. a, ["š"] = "s" .. a, ["ž"] = "z" .. a, ["å"] = "z" .. b, ["ä"] = "z" .. c
}

function export.makeSortKey(text, lang, sc)
	return mw.ustring.upper(mw.ustring.gsub(mw.ustring.lower(text), ".", oneChar))
end

return export
"https://si.wiktionary.org/w/index.php?title=Module:sms-sortkey&oldid=185554" වෙතින් සම්ප්‍රවේශනය කෙරිණි