Jump to content

Module:bnt-com-sortkey

Wiktionary වෙතින්

මෙම මොඩියුලය සඳහා උපදෙස් පත්‍රිකාවක් අවශ්‍ය වෙයි.
මෙම මොඩියුලය හා අදාළ අරමුණු සහ භාවිත උපදෙස්, උපදෙස් පිටුව තුළ ලේඛනගත කිරීමට කාරුණික වන්න.

local export = {}
local u = require("Module:string/char")
local a = u(0xF000)

local oneChar = {
	["ɓ"] = "b" .. a, ["ɗ"] = "d" .. a
}

local twoChars = {
	["v̄"] = "v" .. 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
"https://si.wiktionary.org/w/index.php?title=Module:bnt-com-sortkey&oldid=222024" වෙතින් සම්ප්‍රවේශනය කෙරිණි