Module:Aghb-translit: Difference between revisions

From Linguifex
Jump to navigation Jump to search
m Protected "Module:Aghb-translit": (bot) automatically protect highly visible templates/modules (reference score: 1955+ >= 1000) ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))
 
Created page with "local export = {} local tt = { ["𐔰"]="a", ["𐔱"]="b", ["𐔲"]="g", ["𐔳"]="d", ["𐔴"]="e", ["𐔵"]="z", ["𐔶"]="ē", ["𐔷"]="ž", ["𐔸"]="t", ["𐔹"]="ć̣", ["𐔺"]="y", ["𐔻"]="ź", ["𐔼"]="i", ["𐔽"]="ˁ", ["𐔾"]="l", ["𐔿"]="n'", ["𐕀"]="x", ["𐕁"]="d'", ["𐕂"]="c̣", ["𐕃"]="ʒ́", ["𐕄"]="ḳ", ["𐕅"]="l'", ["𐕆"]="h", ["𐕇"]="x̣", ["𐕈"]="å", ["𐕉"]="ć", ["𐕊"]="č̣", ["𐕋"]="c'", ["𐕌"]="m", ["𐕍"]=..."
(No difference)

Revision as of 23:39, 13 January 2025


This module will transliterate text in the Caucasian Albanian script. It is used to transliterate Aghwan. 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:Aghb-translit/testcases.

Functions

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

local export = {}

local tt = {
	["𐔰"]="a", ["𐔱"]="b", ["𐔲"]="g", ["𐔳"]="d", ["𐔴"]="e", ["𐔵"]="z", ["𐔶"]="ē", ["𐔷"]="ž", ["𐔸"]="t", ["𐔹"]="ć̣", ["𐔺"]="y", ["𐔻"]="ź", ["𐔼"]="i",
	["𐔽"]="ˁ", ["𐔾"]="l", ["𐔿"]="n'", ["𐕀"]="x", ["𐕁"]="d'", ["𐕂"]="c̣", ["𐕃"]="ʒ́", ["𐕄"]="ḳ", ["𐕅"]="l'", ["𐕆"]="h", ["𐕇"]="x̣", ["𐕈"]="å", ["𐕉"]="ć",
	["𐕊"]="č̣", ["𐕋"]="c'", ["𐕌"]="m", ["𐕍"]="q̇", ["𐕎"]="n", ["𐕏"]="ʒˈ", ["𐕐"]="š", ["𐕑"]="ǯ", ["𐕒"]="o", ["𐕓"]="ṭ'", ["𐕔"]="f", ["𐕕"]="ʒ", ["𐕖"]="č",
	["𐕗"]="ṗ", ["𐕘"]="ġ", ["𐕙"]="r", ["𐕚"]="s", ["𐕛"]="v", ["𐕜"]="ṭ", ["𐕝"]="ś", ["𐕞"]="ü", ["𐕟"]="c̣'", ["𐕠"]="c",
	["𐕡"]="w", ["𐕢"]="p", ["𐕣"]="k", ["𐕯"]="»"
};

function export.tr(text, lang, sc)
	text = mw.ustring.gsub(text, '𐕒𐕡', 'u')
	text = mw.ustring.gsub(text, '.', tt)
	
	return text
end

return export