Module:kk-translit: difference between revisions

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Content deleted Content added
updating for new latin alphabet 2018
m That's the new Latin script, but it's not suitable as a romanisation
Tag: Rollback
Line 2: Line 2:


local tt = {
local tt = {
["ү"]="ú",['Ү']='Ú', ["т"]="t",['Т']='T', ["һ"]="h",['Һ']='H', ["р"]="r",['Р']='R', ["ф"]="f",['Ф']='F',
["ү"]="ü",['Ү']='Ü', ["т"]="t",['Т']='T', ["һ"]="h",['Һ']='H', ["р"]="r",['Р']='R', ["ф"]="f",['Ф']='F',
["ю"]="ıý",['Ю']='', ["ш"]="sh",['Ш']='Sh', ["ь"]="",['Ь']='', ["ъ"]="",['Ъ']='', ["н"]="n",['Н']='N',
["ю"]="yw",['Ю']='Yw', ["ш"]="ş",['Ш']='Ş', ["ь"]="ʹ",['Ь']='ʹ', ["ъ"]="ʺ",['Ъ']='ʺ', ["н"]="n",['Н']='N',
["п"]="p",['П']='P', ["й"]="ı",['Й']='I', ["л"]="l",['Л']='L', ["з"]="z",['З']='Z', ["е"]="e",['Е']='E',
["п"]="p",['П']='P', ["й"]="y",['Й']='Y', ["л"]="l",['Л']='L', ["з"]="z",['З']='Z', ["е"]="e",['Е']='E',
["г"]="g",['Г']='G', ["б"]="b",['Б']='B', ["у"]="ý",['У']='Ý', ["с"]="s",['С']='S', ["х"]="h",['Х']='H',
["г"]="g",['Г']='G', ["б"]="b",['Б']='B', ["у"]="w",['У']='W', ["с"]="s",['С']='S', ["х"]="x",['Х']='X',
["ч"]="ch",['Ч']='Ch', ["щ"]="sh",['Щ']='Sh', ["я"]="ıa",['Я']='Ia', ["ы"]="y",['Ы']='Y', ["э"]="e",['Э']='E',
["ч"]="ç",['Ч']='Ç', ["щ"]="şş",['Щ']='Şş', ["я"]="ya",['Я']='Ya', ["ы"]="ı",['Ы']='I', ["э"]="e",['Э']='E',
["м"]="m",['М']='M', ["о"]="o",['О']='O', ["и"]="ı",['И']='I', ["ё"]="e",['Ё']='E', ["ж"]="j",['Ж']='J',
["м"]="m",['М']='M', ["о"]="o",['О']='O', ["и"]="ï",['И']='Ï', ["ё"]="yo",['Ё']='Yo', ["ж"]="j",['Ж']='J',
["к"]="k",['К']='K', ["д"]="d",['Д']='D', ["в"]="v",['В']='V', ["ц"]="ts",['Ц']='Ts', ["а"]="a",['А']='A',
["к"]="k",['К']='K', ["д"]="d",['Д']='D', ["в"]="v",['В']='V', ["ц"]="c",['Ц']='C', ["а"]="a",['А']='A',
["ң"]="ń",['Ң']='Ń', ["ә"]="á",['Ә']='Á', ["э"]="e",['Э']='E', ["ұ"]="u",['Ұ']='U', ["қ"]="q",['Қ']="Q",
["ң"]="ñ",['Ң']='Ñ', ["ә"]="ä",['Ә']='Ä', ["э"]="é",['Э']='É', ["ұ"]="u",['Ұ']='U', ["қ"]="q",['Қ']="Q",
["ғ"]="ǵ",['Ғ']='Ǵ', ["і"]="i",['І']='I', ["ө"]="ó",['Ө']='Ó', ["ӯ"]="u",['Ӯ']='U'
["ғ"]="ğ",['Ғ']='Ğ', ["і"]="i",['І']='İ', ["ө"]="ö",['Ө']='Ö', ["ӯ"]="u",['Ӯ']='U'
};
};



Revision as of 05:29, 15 March 2018

Notice: This module is not the primary transliteration module for Kazakh, for that see Module:languages/data/2. This module generates Latin spellings for Template:kk-alt.

For the Yañalif (old Latin spelling) correspondence, see this correspondence chart written in 1931 in the Soviet Union, and this chart on Kazakh Wikipedia.

Transliteration information

This module will transliterate Kazakh language text per WT:KK 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:kk-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 = {
	["ү"]="ü",['Ү']='Ü',   ["т"]="t",['Т']='T', ["һ"]="h",['Һ']='H', ["р"]="r",['Р']='R',   ["ф"]="f",['Ф']='F',
	["ю"]="yw",['Ю']='Yw', ["ш"]="ş",['Ш']='Ş', ["ь"]="ʹ",['Ь']='ʹ',   ["ъ"]="ʺ",['Ъ']='ʺ', ["н"]="n",['Н']='N', 
	["п"]="p",['П']='P',   ["й"]="y",['Й']='Y', ["л"]="l",['Л']='L',   ["з"]="z",['З']='Z', ["е"]="e",['Е']='E', 
	["г"]="g",['Г']='G',   ["б"]="b",['Б']='B', ["у"]="w",['У']='W',   ["с"]="s",['С']='S', ["х"]="x",['Х']='X',
	["ч"]="ç",['Ч']='Ç', ["щ"]="şş",['Щ']='Şş', ["я"]="ya",['Я']='Ya', ["ы"]="ı",['Ы']='I', ["э"]="e",['Э']='E', 
	["м"]="m",['М']='M',   ["о"]="o",['О']='O', ["и"]="ï",['И']='Ï', ["ё"]="yo",['Ё']='Yo', ["ж"]="j",['Ж']='J',
	["к"]="k",['К']='K',   ["д"]="d",['Д']='D', ["в"]="v",['В']='V', ["ц"]="c",['Ц']='C', ["а"]="a",['А']='A',
	["ң"]="ñ",['Ң']='Ñ',   ["ә"]="ä",['Ә']='Ä', ["э"]="é",['Э']='É', ["ұ"]="u",['Ұ']='U', ["қ"]="q",['Қ']="Q",
	["ғ"]="ğ",['Ғ']='Ğ',   ["і"]="i",['І']='İ', ["ө"]="ö",['Ө']='Ö', ["ӯ"]="u",['Ӯ']='U'
};

function export.tr(text, lang, sc)
	if sc == "Cyrl" then
		return (mw.ustring.gsub(text, '.', tt))
	end
end

return export