Module:Geor-translit

Definition from Wiktionary, the free dictionary
Jump to: navigation, search
The following documentation is located at Module:Geor-translit/documentation. [edit]
Useful links: subpage listtransclusionstestcases

This module will transliterate text in the Georgian script per WT:GEOR TR.

The module should preferably not be called directly from templates or other modules. To use it from a template, use {{xlit}}. Within a module, use Module:languages#Language:transliterate.

For testcases, see Module:Geor-translit/testcases.

Functions[edit]

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by sc, and language specified by lang. When the transliteration fails, returns nil.

local export = {}
 
local tt = {
	["ა"]="a", ["ბ"]="b", ["გ"]="g", ["დ"]="d", ["ე"]="e", ["ვ"]="v", ["ზ"]="z", ["ჱ"]="ē",
	["თ"]="t’", ["ი"]="i", ["კ"]="k", ["ლ"]="l", ["მ"]="m", ["ნ"]="n", ["ჲ"]="y", ["ო"]="o",
	["პ"]="p", ["ჟ"]="ž", ["რ"]="r", ["ს"]="s", ["ტ"]="t", ["ჳ"]="w", ["უ"]="u", ["ფ"]="p’",
	["ქ"]="k’", ["ღ"]="ḡ", ["ყ"]="q", ["შ"]="š", ["ჩ"]="č’", ["ც"]="c’",
	["ძ"]="j", ["წ"]="c", ["ჭ"]="č", ["ხ"]="x", ["ჴ"]="ẖ", ["ჯ"]="ǰ", ["ჰ"]="h", ["ჵ"]="ō", ["ჶ"]="f", ["ჷ"]="ə", ["ჸ"]="ʾ"
};
 
function export.tr(text, lang, sc)
	return (mw.ustring.gsub(text, '.', tt))
end
 
return export