Module:kru-Tols-translit: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m 1 revision imported |
(No difference)
| |
Latest revision as of 12:46, 21 April 2026
Documentation for this module may be created at Module:kru-Tols-translit/doc
local m_str_utils = require("Module:string utilities")
local gsub = m_str_utils.gsub
local sub = m_str_utils.sub
local U = m_str_utils.char
local export = {}
local tt = {
-- vowels
[""] = "i", [""] = "e", [""] = "u", [""] = "o", [""] = "a", [""] = "ā",
-- consonants
[""] = "p", [""] = "ph", [""] = "b", [""] = "bh", [""] = "m",
[""] = "t", [""] = "th", [""] = "d", [""] = "dh", [""] = "n",
[""] = "ṭ", [""] = "ṭh", [""] = "ḍ", [""] = "ḍh", [""] = "ṇ",
[""] = "c", [""] = "ch", [""] = "j", [""] = "jh", [""] = "ñ",
[""] = "k", [""] = "kh", [""] = "g", [""] = "gh", [""] = "ṅ",
[""] = "y", [""] = "r", [""] = "l", [""] = "v", [""] = "n̤",
[""] = "s", [""] = "h", [""] = "x", [""] = "ṛ", [""] = "ṛh",
-- diacritics
[""] = "̄", [""] ="ʻ",
-- numerals
[""] = "0", [""] = "1", [""] = "2", [""] = "3", [""] = "4",
[""] = "5", [""] = "6", [""] = "7", [""] = "8", [""] = "9"
}
-- transliterates any words or phrases
function export.tr(text, lang, sc)
text = gsub(text, ".", tt)
return text
end
return export