एकक:Cher-translit
Disnnem
Documentation for this module may be created at एकक:Cher-translit/doc
local export = {}
local m_cher = require("Module:Cher-common")
local m_str_utils = require("Module:string utilities")
local gsub = m_str_utils.gsub
-- transliteration export function
function export.tr(text, lang, sc)
-- ensure all Cherokee characters are uppercase
text = m_str_utils.upper(text)
-- substitute values generatively from syllable list dictionary
for c, v in pairs(m_cher.syl_list) do
for i, cher in ipairs(v) do
text = gsub(text, cher, c .. m_cher.vowel_order[i])
end
end
-- handle special cases for Ꮐ and Ꮝ
text = gsub(text, "Ꮐna", "Ꮐ'na") -- add apostrophe between Ꮐ and Ꮎ
text = gsub(text, "Ꮝ([aeiouv])", "Ꮝ'%1") -- add apostrophe between Ꮝ and a vowel
text = gsub(text, ".", {["Ꮐ"] = "nah", ["Ꮝ"] = "s"}) -- then substitute those values
return text
end
return export