r103643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103642‎ | r103643 | r103644 >
Date:06:08, 19 November 2011
Author:santhosh
Status:ok
Tags:
Comment:
First version of Marathi Transliteration keymapping, based on Sanskrit keymapping.
By Abhijeet Pathak
#IndiaMWHack11
Modified paths:
  • /trunk/extensions/Narayam/Narayam.i18n.php (modified) (history)
  • /trunk/extensions/Narayam/Narayam.php (modified) (history)
  • /trunk/extensions/Narayam/js/ext.narayam.rules.mr.js (added) (history)

Diff [purge]

Index: trunk/extensions/Narayam/Narayam.i18n.php
@@ -34,6 +34,7 @@
3535 'narayam-kn-inscript' => 'Kannada InScript',
3636 'narayam-ml' => 'Malayalam Transliteration',
3737 'narayam-ml-inscript' => 'Malayalam InScript',
 38+ 'narayam-mr' => 'Marathi Transliteration',
3839 'narayam-ne' => 'Nepali Transliteration',
3940 'narayam-ne-inscript' => 'Nepali InScript',
4041 'narayam-or' => 'Oriya Transliteration',
Index: trunk/extensions/Narayam/js/ext.narayam.rules.mr.js
@@ -0,0 +1,168 @@
 2+/**
 3+ * Trasliteration regular expression rules table for Marathi
 4+ * @author Pathak A B ([[user:Pathak.ab]])
 5+ * @date 2011-11-19
 6+ * @credits With help from Amir E Aharani
 7+ * License: GPLv3, CC-BY-SA 3.0
 8+ */
 9+
 10+ // Normal rules
 11+var rules = [
 12+['क्h','c','च्'],
 13+['\\\\([A-Za-z\\>_~\\.0-9])','\\\\','$1'],
 14+
 15+
 16+['([क-ह]़?)्a', '','$1'],
 17+['([क-ह]़?)्A', '','$1ा'],
 18+['([क-ह]़?)a', '','$1ा'],
 19+['([क-ह]़?)्i', '','$1ि'],
 20+['([क-ह]़?)(्I|िi|ॆe)', '','$1ी'],
 21+['([क-ह]़?)्u', '','$1ु'],
 22+['([क-ह]़?)(ुu|्U|ॊo)', '','$1ू'],
 23+['([क-ह]़?)्R', '','$1ृ'],
 24+['([क-ह]़?)ृR', '','$1ॄ'],
 25+['([क-ह]़?)्ळ्l', '','$1ॢ'],
 26+['([क-ह]़?)ॢl', '','$1ॣ'],
 27+['([क-ह]़?)ॆ\\^', '','$1ॅ'],
 28+['([क-ह]़?)्e', '','$1ॆ'],
 29+['([क-ह]़?)्E', '','$1े'],
 30+['([क-ह]़?)ॊ\\^', '','$1ॉ'],
 31+['([क-ह]़?)i', '','$1ै'],
 32+['([क-ह]़?)्o', '','$1ॊ'],
 33+['([क-ह]़?)्O', '','$1ो'],
 34+['([क-ह]़?)u', '','$1ौ'],
 35+['([क-ह]़?)ृa', '','$1्ऱ'],
 36+['([क-ह]़?)ृA', '','$1्ऱा'],
 37+['([क-ह]़?)ृi', '','$1्ऱि'],
 38+['([क-ह]़?)ृI', '','$1्ऱी'],
 39+['([क-ह]़?)ृu', '','$1्ऱु'],
 40+['([क-ह]़?)ृU', '','$1्ऱू'],
 41+['([क-ह]़?)ृ\\^', '','$1्ऱॅ'],
 42+['([क-ह]़?)ृe', '','$1्ऱॆ'],
 43+['([क-ह]़?)ृE', '','$1्ऱे'],
 44+['([क-ह]़?)ृo', '','$1्ऱॊ'],
 45+['([क-ह]़?)ृO', '','$1्ऱो'],
 46+['([क-ह]़?)ृ\\~', '','$1्ऱ्'],
 47+['([क-ह])्\\`', '','$1़्'],
 48+
 49+['अa', '','आ'],
 50+['(ऒo|उu)', '','ऊ'],
 51+['ऎ\\^', '','ऍ'],
 52+['अi', '','ऐ'],
 53+['अ\\^', '','ॲ'],
 54+['(इi|ऎe)', '','ई'],
 55+['ऒ\\^', '','ऑ'],
 56+['अu', '','औ'],
 57+['ऋR', '','ॠ'],
 58+['ळ्l', '','ऌ'],
 59+['ऌl', '','ॡ'],
 60+['ं\\^', '','ँ'],
 61+['ंm', '','ँ'],
 62+['ओM', '','ॐ'],
 63+
 64+['र्Y', '','ऱ्य्'],
 65+
 66+['क्h', '','ख्'],//kh
 67+['ग्h', '','घ्'],
 68+['न्g', '','ङ्'],
 69+['च्h', '','छ्'],
 70+['ज्h', '','झ्'],
 71+['न्j', '','ञ्'],
 72+['ट्h', '','ठ्'],
 73+['ड्h', '','ढ्'],
 74+['त्h', '','थ्'],
 75+['द्h', '','ध्'],
 76+['प्h', '','फ्'],
 77+['ब्h', '','भ्'],
 78+['ऋa', '','ऱ'],
 79+['ऋA', '','ऱा'],
 80+['ऋi', '','ऱि'],
 81+['ऋI', '','ऱी'],
 82+['ऋu', '','ऱु'],
 83+['ऋU', '','ऱू'],
 84+['ऋ\\^', '','ऱॅ'],
 85+['ऋe', '','ऱॆ'],
 86+['ऋE', '','ऱे'],
 87+['ऋo', '','ऱॊ'],
 88+['ऋO', '','ऱो'],
 89+['ऋ\\~', '','ऱ्'],
 90+
 91+['स्h', '','ष्'],
 92+['क़्h', '','ख़्'],
 93+['ज़्h', '','ऴ्'],
 94+['।\\.', '','॥'],
 95+
 96+['a', '','अ'],
 97+['b', '','ब्'],
 98+['c', '','क्'],
 99+['d', '','द्'],
 100+['e', '','ऎ'],
 101+['(f|F)', '','फ़्'],
 102+['g', '','ग्'],
 103+['h', '','ह्'],
 104+['i', '','इ'],
 105+['j', '','ज्'],
 106+['k', '','क्'],
 107+['l', '','ल्'],
 108+['m', '','म्'],
 109+['n', '','न्'],
 110+['o', '','ऒ'],
 111+['p', '','प्'],
 112+['q', '','क़्'],
 113+['r', '','र्'],
 114+['s', '','स्'],
 115+['t', '','त्'],
 116+['u', '','उ'],
 117+['(v|w)', '','व्'],
 118+['x', '','क्ष्'],
 119+['y', '','य्'],
 120+['(z|Z)', '','ज़्'],
 121+['A', '','आ'],
 122+['B', '','ब्ब्'],
 123+['C', '','क्क्'],
 124+['D', '','ड्'],
 125+['E', '','ए'],
 126+//'F', '','फ्'],
 127+['G', '','ग्ग्'],
 128+['H', '','ः'],
 129+['I', '','ई'],
 130+['J', '','ज्ज्'],
 131+['K', '','क्क्'],
 132+['L', '','ळ्'],
 133+['M', '','ं'],
 134+['N', '','ण्'],
 135+['O', '','ओ'],
 136+['P', '','प्प्'],
 137+//'Q', '','अ'],
 138+['R', '','ऋ'],
 139+['S', '','श्'],
 140+['T', '','ट्'],
 141+['U', '','ऊ'],
 142+['(V|W)', '','व्व्'],
 143+['X', '','क्ष्'],
 144+['Y', '','य्य्'],
 145+//'z', '','अ'
 146+['0', '','०'],
 147+['1', '','१'],
 148+['2', '','२'],
 149+['3', '','३'],
 150+['4', '','४'],
 151+['5', '','५'],
 152+['6', '','६'],
 153+['7', '','७'],
 154+['8', '','८'],
 155+['9', '','९'],
 156+['~', '','्'],
 157+['\\.', '','।'],
 158+['//', '','ऽ'],
 159+['\\`', '','़'],
 160+['(\u200C)*_', '', '\u200c']
 161+];
 162+
 163+jQuery.narayam.addScheme( 'mr', {
 164+ 'namemsg': 'narayam-mr',
 165+ 'extended_keyboard': false,
 166+ 'lookbackLength': 4,
 167+ 'keyBufferLength': 2,
 168+ 'rules': rules
 169+} );
Property changes on: trunk/extensions/Narayam/js/ext.narayam.rules.mr.js
___________________________________________________________________
Added: svn:eol-style
1170 + native
Index: trunk/extensions/Narayam/Narayam.php
@@ -75,6 +75,9 @@
7676 'ml' => 'ext.narayam.rules.ml',
7777 'ml-inscript' => 'ext.narayam.rules.ml-inscript',
7878 ),
 79+ 'mr' => array(
 80+ 'mr' => 'ext.narayam.rules.mr',
 81+ ),
7982 'ne' => array(
8083 'ne' => 'ext.narayam.rules.ne',
8184 'ne-inscript' => 'ext.narayam.rules.ne-inscript',
@@ -152,6 +155,7 @@
153156 'narayam-kn-inscript',
154157 'narayam-ml',
155158 'narayam-ml-inscript' ,
 159+ 'narayam-mr',
156160 'narayam-ne',
157161 'narayam-ne-inscript',
158162 'narayam-or',
@@ -226,6 +230,10 @@
227231 'scripts' => 'js/ext.narayam.rules.ml.js',
228232 'dependencies' => 'ext.narayam.core',
229233 );
 234+$wgResourceModules['ext.narayam.rules.mr'] = $narayamTpl + array(
 235+ 'scripts' => 'js/ext.narayam.rules.mr.js',
 236+ 'dependencies' => 'ext.narayam.core',
 237+);
230238 $wgResourceModules['ext.narayam.rules.ml-inscript'] = $narayamTpl + array(
231239 'scripts' => 'js/ext.narayam.rules.ml-inscript.js',
232240 'dependencies' => 'ext.narayam.core',

Status & tagging log