มอดูล:Geor-translit

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

ข้อผิดพลาด Lua ใน package.lua บรรทัดที่ 80: module 'Module:families/track-bad-etym-code' not found


local export = {}
local gsub = mw.ustring.gsub
local u = mw.ustring.char
local letter_with_mark = '(.ฺ?['..u(0x0300)..'-'..u(0x036F)..']*)'
 
local tt = {
	-- consonants & back vowels
	['ა'] = 'า', ['ბ'] = 'บ', ['გ'] = 'กฺ', ['დ'] = 'ด', ['ვ'] = 'วฺ', ['ზ'] = 'ซฺ', 
	['თ'] = 'ท', ['ი'] = 'ี', ['კ'] = 'ก͓', ['ლ'] = 'ล', ['მ'] = 'ม', ['ნ'] = 'น', ['ჼ'] = 'น์', ['ჲ'] = 'ย', ['ო'] = 'อ̂',
	['პ'] = 'ป͓', ['ჟ'] = 'ฌฺ', ['რ'] = 'ร', ['ს'] = 'ซ', ['ტ'] = 'ต͓', ['ჳ'] = 'ว', ['უ'] = 'ู', ['ფ'] = 'พ',
	['ქ'] = 'ค', ['ღ'] = 'ฆ', ['ყ'] = 'ฃ͓', ['შ'] = 'ฌ', ['ჩ'] = 'ช', ['ც'] = 'ท͜ซ',
	['ძ'] = 'ด͜ซฺ', ['წ'] = 'ต͜ซ͓', ['ჭ'] = 'จ͓', ['ხ'] = 'ฅ',
	['ჴ'] = 'ฃ', ['ჯ'] = 'จฺ', ['ჰ'] = 'ฮ', ['ჶ'] = 'ฟ', ['ჸ'] = 'อ', ['ჺ'] = 'อฺ',
	-- some punctuations
	['„'] = '“', ['“'] = '”', ['჻'] = '๚',
}

local adjust1 = {
	-- front vowels
	['ე'] = 'แ%1', ['ჱ'] = 'เ%1', ['ჵ'] = 'โ%1', ['ჷ'] = 'เ%1อ̂', ['ჽ'] = 'เ%1อ̂'
}

function export.tr(text, lang, sc)

	if type(text) == 'table' then -- called directly from a template
		text = text.args[1]
	end

	text = mw.ustring.lower(text) -- to support Georgian Extended

	-- เติม อ ถ้าพยางค์แรกเป็นสระ หรือสระติดกัน
	text = gsub(text, '^([აიოუეჱჵჷჽ])', 'ჸ%1')
	text = gsub(text, '([%s%p%d])([აიოუეჱჵჷჽ])', '%1ჸ%2')
	text = gsub(text, '([აიოუეჱჵჷჽ])([აიოუეჱჵჷჽ])', '%1ჸ%2')
	text = gsub(text, '([აიოუეჱჵჷჽ])([აიოუეჱჵჷჽ])', '%1ჸ%2') --twice

	text = gsub(text, '.', tt)

	for k, v in pairs(adjust1) do
		text = gsub(text, letter_with_mark..k, v)
	end

	-- ย้ายสัญลักษณ์ขึ้นบน เมื่อมีสระล่าง (ยกเว้นตัวที่ไม่มี)
	text = gsub(text, u(0x0353)..'([ุ-ฺ])', u(0x033D)..'%1') -- x below > x above

	return text

end
 
return export