local export = {}
local m_str_utils = require("Module:string utilities")
local gmatch = m_str_utils.gmatch
local gsub = m_str_utils.gsub
local u = m_str_utils.char
local minorMarkSet = "()"
local minorMarks = {
= "0", = "1", = "2", = "3", = "4",
= "5", = "6", = "7", = "8", = "9", = "A"
}
function export.makeSortKey(text, lang, sc)
local minorKey = ""
for mark in gmatch(text, minorMarkSet) do
minorKey = minorKey .. minorMarks
end
text = gsub(text, minorMarkSet, "")
text = gsub(text, "", "")
text = gsub(text, "()(ʼ?)", "%2%1")
return text .. minorKey
end
return export