Jump to content

Module:egy-utilities/data

From Wiktionary, the free dictionary

This module needs documentation.
Please document this module by describing its purpose and usage on the documentation page.

local u = require("Module:string/char")
local ulen = mw.ustring.len

local sortkey_replacements = {}
local alphabet = "ꜣ j y ꜥ w b p f m n r h ḥ ḫ ẖ z s š q k g t ṯ d ḏ"
local replacement_codepoint = 0xE000 -- Private Use Area; the ConScript Unicode Registry uses this particular section for Tengwar
for letter in alphabet:gmatch("%S+") do
	if ulen(letter) > 1 then
		error("The letter " .. letter .. " is not one character.")
	end
	replacement_codepoint = replacement_codepoint + 1
	sortkey_replacements[letter] = u(replacement_codepoint)
end

return sortkey_replacements