ข้ามไปเนื้อหา

มอดูล:Cher-translit

จาก วิกิพจนานุกรม พจนานุกรมเสรี

This module will transliterate text in the อักษรเชโรกี. It is used to transliterate เชโรกี. 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:Cher-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 = {
	['Ꭰ'] = 'อา',
	['Ꭱ'] = 'เอ',
	['Ꭲ'] = 'อี',
	['Ꭳ'] = 'โอ',
	['Ꭴ'] = 'อู',
	['Ꭵ'] = 'เอิน์',
	
	['Ꭶ'] = 'กา',
	['Ꭷ'] = 'คา',
	['Ꭸ'] = 'เก',
	['Ꭹ'] = 'กี',
	['Ꭺ'] = 'โก',
	['Ꭻ'] = 'กู',
	['Ꭼ'] = 'เกิน์',
	
	['Ꭽ'] = 'ฮา',
	['Ꭾ'] = 'เฮ',
	['Ꭿ'] = 'ฮี',
	['Ꮀ'] = 'โฮ',
	['Ꮁ'] = 'ฮู',
	['Ꮂ'] = 'เฮิน์',
	
	['Ꮃ'] = 'ลา',
	['Ꮄ'] = 'เล',
	['Ꮅ'] = 'ลี',
	['Ꮆ'] = 'โล',
	['Ꮇ'] = 'ลู',
	['Ꮈ'] = 'เลิน์',
	
	['Ꮉ'] = 'มา',
	['Ꮊ'] = 'เม',
	['Ꮋ'] = 'มี',
	['Ꮌ'] = 'โม',
	['Ꮍ'] = 'มู',
	['Ᏽ'] = 'เมิน์',
	
	['Ꮎ'] = 'นา',
	['Ꮏ'] = 'ฮฺนา',
	['Ꮐ'] = 'นาฮ',
	['Ꮑ'] = 'เน',
	['Ꮒ'] = 'นี',
	['Ꮓ'] = 'โน',
	['Ꮔ'] = 'นู',
	['Ꮕ'] = 'เนิน์',
	
	['Ꮖ'] = 'คฺวา',
	['Ꮗ'] = 'คฺเว',
	['Ꮘ'] = 'คฺวี',
	['Ꮙ'] = 'คฺโว',
	['Ꮚ'] = 'คฺวู',
	['Ꮛ'] = 'คฺเวิน์',
	
	['Ꮝ'] = 'ส',
	['Ꮜ'] = 'ซา',
	['Ꮞ'] = 'เซ',
	['Ꮟ'] = 'ซี',
	['Ꮠ'] = 'โซ',
	['Ꮡ'] = 'ซู',
	['Ꮢ'] = 'เซิน์',
	
	['Ꮣ'] = 'ดา',
	['Ꮤ'] = 'ทา',
	['Ꮥ'] = 'เด',
	['Ꮦ'] = 'เท',
	['Ꮧ'] = 'ดี',
	['Ꮨ'] = 'ที',
	['Ꮩ'] = 'โด',
	['Ꮪ'] = 'ดู',
	['Ꮫ'] = 'เดิน์',
	
	['Ꮬ'] = 'ดฺลา',
	['Ꮭ'] = 'ทฺลา',
	['Ꮮ'] = 'ทฺเล',
	['Ꮯ'] = 'ทฺลี',
	['Ꮰ'] = 'ทฺโล',
	['Ꮱ'] = 'ทฺลู',
	['Ꮲ'] = 'ทฺเลิน์',
	
	['Ꮳ'] = 'ทฺซา',
	['Ꮴ'] = 'ทฺเซ',
	['Ꮵ'] = 'ทฺซี',
	['Ꮶ'] = 'ทฺโซ',
	['Ꮷ'] = 'ทฺซู',
	['Ꮸ'] = 'ทฺเซิน์',
	
	['Ꮹ'] = 'วา',
	['Ꮺ'] = 'เว',
	['Ꮻ'] = 'วี',
	['Ꮼ'] = 'โว',
	['Ꮽ'] = 'วู',
	['Ꮾ'] = 'เวิน์',
	
	['Ꮿ'] = 'ยา',
	['Ᏸ'] = 'เย',
	['Ᏹ'] = 'ยี',
	['Ᏺ'] = 'โย',
	['Ᏻ'] = 'ยู',
	['Ᏼ'] = 'เยิน์',
}

function export.tr(text)

	text = mw.ustring.gsub(text, '.', tt)
	
	return text

end

return export