local export = {}
local PAGENAME = mw.title.getCurrentTitle().text
local lang = require("Module:languages").getByCode("egy")
function export.common(word)
if type(word) == "table" then
word = word.args or word:getParent().args
end
if not word or (word == "") then
word = PAGENAME
end
return word
end
function export.to_MDC(word)
mdc = export.common(word)
mdc = mw.ustring.gsub(mdc, "ꜣ", "A")
mdc = mw.ustring.gsub(mdc, "j", "i")
mdc = mw.ustring.gsub(mdc, "ï", "y")
mdc = mw.ustring.gsub(mdc, "ꜥ", "a")
mdc = mw.ustring.gsub(mdc, "ḥ", "H")
mdc = mw.ustring.gsub(mdc, "ḫ", "x")
mdc = mw.ustring.gsub(mdc, "ẖ", "X")
mdc = mw.ustring.gsub(mdc, "š", "S")
mdc = mw.ustring.gsub(mdc, "ṯ", "T")
mdc = mw.ustring.gsub(mdc, "ḏ", "D")
mdc = mw.ustring.gsub(mdc, ",", "")
mdc = mw.ustring.gsub(mdc, "⸗", ".")
return mdc
end
function export.to_Gardiner(word)
gardiner = export.common(word)
gardiner = mw.ustring.gsub(gardiner, "j", "ꞽ")
gardiner = mw.ustring.gsub(gardiner, "ï", "y")
gardiner = mw.ustring.gsub(gardiner, "z", "s")
gardiner = mw.ustring.gsub(gardiner, "q", "ḳ")
gardiner = mw.ustring.gsub(gardiner, ",", "")
gardiner = mw.ustring.gsub(gardiner, "%.", "·")
gardiner = mw.ustring.gsub(gardiner, "⸗", "·")
return gardiner
end
function export.to_e_g(word)
e_g = export.common(word)
e_g = mw.ustring.gsub(e_g, "s,", "s")
e_g = mw.ustring.gsub(e_g, "%.jn⸗?", "-jn")
e_g = mw.ustring.gsub(e_g, "%.ḫr⸗?", "-ḫr")
e_g = mw.ustring.gsub(e_g, "%.kꜣ⸗?", "-kꜣ")
e_g = mw.ustring.gsub(e_g, "%fj", "ꞽ")
e_g = mw.ustring.gsub(e_g, "ï", "j")
e_g = mw.ustring.gsub(e_g, "y", "j")
e_g = mw.ustring.gsub(e_g, ",wt", "w,t")
e_g = mw.ustring.gsub(e_g, ",w", "w")
e_g = mw.ustring.gsub(e_g, ",jt", "j,t")
e_g = mw.ustring.gsub(e_g, ",j", "j")
e_g = mw.ustring.gsub(e_g, ",tt", ",t,t")
e_g = mw.ustring.gsub(e_g, "s", "ś")
e_g = mw.ustring.gsub(e_g, "z", "s")
e_g = mw.ustring.gsub(e_g, "q", "ḳ")
e_g = mw.ustring.gsub(e_g, ",", "·")
e_g = mw.ustring.gsub(e_g, "%.", "")
e_g = mw.ustring.gsub(e_g, "ꞽw⸗", "ꞽw")
e_g = mw.ustring.gsub(e_g, "⸗", "·") -- inconsistently; sometimes omitted
return e_g
end
function export.to_Lepsius(word)
lepsius = export.common(word)
lepsius = mw.ustring.gsub(lepsius, ",wt", "w-t") -- historically tw instead, but this was based on a misreading
lepsius = mw.ustring.gsub(lepsius, ",yt", "y-t")
lepsius = mw.ustring.gsub(lepsius, ",jt", "j-t")
lepsius = mw.ustring.gsub(lepsius, ",tt", "t-t")
lepsius = mw.ustring.gsub(lepsius, ",t", "-t")
lepsius = mw.ustring.gsub(lepsius, "s,", "se-")
lepsius = mw.ustring.gsub(lepsius, "%.jn", " jn")
lepsius = mw.ustring.gsub(lepsius, "%.ḫr", " ḫr")
lepsius = mw.ustring.gsub(lepsius, "%.kꜣ", " kꜣ")
lepsius = mw.ustring.gsub(lepsius, "ꜣ", "a")
lepsius = mw.ustring.gsub(lepsius, "j", "ȧ")
lepsius = mw.ustring.gsub(lepsius, "ï", "i")
lepsius = mw.ustring.gsub(lepsius, "y", "ī")
lepsius = mw.ustring.gsub(lepsius, "ꜥ", "ā")
-- lepsius = mw.ustring.gsub(lepsius, "rw", "l") -- only when represented by the lion glyph
lepsius = mw.ustring.gsub(lepsius, "w", "u")
lepsius = mw.ustring.gsub(lepsius, "ḫ", "χ")
lepsius = mw.ustring.gsub(lepsius, "ẖ", "χ")
lepsius = mw.ustring.gsub(lepsius, "z", "s")
lepsius = mw.ustring.gsub(lepsius, "g", "ḳ")
lepsius = mw.ustring.gsub(lepsius, "ṯ", "θ")
lepsius = mw.ustring.gsub(lepsius, "d", "ṭ")
lepsius = mw.ustring.gsub(lepsius, ",", "")
lepsius = mw.ustring.gsub(lepsius, "%.", "")
lepsius = mw.ustring.gsub(lepsius, "%fn⸗", "n")
lepsius = mw.ustring.gsub(lepsius, "⸗", "-")
-- e-epenthesis
lepsius = mw.ustring.gsub(lepsius, "%f()%f", "e%1")
lepsius = mw.ustring.gsub(lepsius, "%fnt", "ent")
lepsius = mw.ustring.gsub(lepsius, "()()()()", "%1%2v%3%4")
lepsius = mw.ustring.gsub(lepsius, "()()%f", "%1v%2")
lepsius = mw.ustring.gsub(lepsius, "()()%f", "%1v%2")
lepsius = mw.ustring.gsub(lepsius, "%f()v()%f", "%1e%2")
lepsius = mw.ustring.gsub(lepsius, "()()", "%1e%2")
lepsius = mw.ustring.gsub(lepsius, "()()%f", "%1e%2")
lepsius = mw.ustring.gsub(lepsius, "v", "")
lepsius = mw.ustring.gsub(lepsius, "()()e()e", "%1%2%3e")
lepsius = mw.ustring.gsub(lepsius, "ḏ", "t′")
return lepsius
end
return export