Module:kru-Tols-translit

From Linguifex
Revision as of 16:32, 2 October 2025 by wikt>G0d0 2019
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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