Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Wiktionary
  2. Module:sa-Guru-translit
Module:sa-Guru-translit
From Wiktionary, the free dictionary

The following documentation is generated by Module:documentation/functions/translit. [edit]
Useful links: subpage list • links • transclusions • testcases • sandbox

This module will transliterate Sanskrit language text per WT:SA 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:sa-Guru-translit/testcases.

Functions

[edit]
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 m_str_utils = require("Module:string utilities")
local gsub = m_str_utils.gsub

local consonants = {
	['ਕ']='k', ['ਖ']='kh', ['ਗ']='g', ['ਘ']='gh', ['ਙ']='ṅ',
	['ਚ']='c', ['ਛ']='ch', ['ਜ']='j', ['ਝ']='jh', ['ਞ']='ñ', 
	['ਟ']='ṭ', ['ਠ']='ṭh', ['ਡ']='ḍ', ['ਢ']='ḍh', ['ਣ']='ṇ', 
	['ਤ']='t', ['ਥ']='th', ['ਦ']='d', ['ਧ']='dh', ['ਨ']='n', 
	['ਪ']='p', ['ਫ']='ph', ['ਬ']='b', ['ਭ']='bh', ['ਮ']='m',
	['ਯ']='y', ['ਰ']='r', ['ਲ']='l', ['ਵ']='v', ['ਲ਼']='ḷ',
	['ਸ਼']='ś', ['ਸ਼']='ṣ', ['ਸ']='s', ['ਹ']='h',
}

local diacritics = {
	['ਾ']='ā', ['ਿ']='i', ['ੀ']='ī', ['ੁ']='u', ['ੂ']='ū', ['੍']='ṛ', ['ୄ']='ṝ', 
	['ୢ']='ḷ', ['ୣ']='ḹ', ['ੇ']='e', ['ੈ']='ai', ['ੋ']='o', ['ੌ']='au',  ['੍']='',
}

local tt = {
	-- vowels
	["ਅ"] = "a", ["ਆ"] = "ā",
	["ਇ"] = "i", ["ਈ"] = "ī",
	["ਉ"] = "u", ["ਊ"] = "ū",
	["ਏ"] = "e", ["ਐ"] = "ai",
	["ਓ"] = "o", ["ਔ"] = "au",
	-- chandrabindu    
	['ਁ']='m̐', --until a better method is found
	-- anusvara    
	['ਂ']='ṃ', --until a better method is found
	-- visarga    
	['ਃ']='ḥ',
	-- avagraha
	['ऽ']='’',
	--numerals
	["੦"] = "0", ["੧"] = "1", ["੨"] = "2", ["੩"] = "3", ["੪"] = "4", ["੫"] = "5", ["੬"] = "6", ["੭"] = "7", ["੮"] = "8", ["੯"] = "9",
	--punctuation        
    ['॥']='.', --double danda
	['।']='.', --danda
    --reconstructed
    ['*'] = '',
}

function export.tr(text, lang, sc)
	text = gsub(
		text,
		'([ਸਹਕਖਗਘਙਚਛਜਝਞਟਠਡਢਣਤਥਦਧਨਪਫਬਭਮਯਰਲਵ])'..
		'([ਾਿੀੁੂ੍ୄୢୣੇੈੋੌ੍]?)',
		function(c, d)
			if d == "" then        
				return consonants[c] .. 'a'
			else
				return consonants[c] .. diacritics[d]
			end
		end)

	text = gsub(text, '.', tt)
	
	return text
end
 
return export
Retrieved from "https://en.wiktionary.org/w/index.php?title=Module:sa-Guru-translit&oldid=82439311"
Categories:
  • Transliteration modules used by 1 language
  • Gurmukhi script
  • Sanskrit modules
  • Transliteration modules
  • Transliteration modules by script
  • Gurmukhi script modules

  • indonesia
  • Polski
  • العربية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصرى
  • Nederlands
  • 日本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українська
  • Tiếng Việt
  • Winaray
  • 中文
  • Русский
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id