r111230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111229‎ | r111230 | r111231 >
Date:12:12, 11 February 2012
Author:amire80
Status:ok
Tags:
Comment:
Adding the first draft of Punjabi transliteration layout. Semi-automatically created from Hindi transliteration, probably incomplete.
Modified paths:
  • /trunk/extensions/Narayam/Narayam.i18n.php (modified) (history)
  • /trunk/extensions/Narayam/Narayam.php (modified) (history)
  • /trunk/extensions/Narayam/resources/ext.narayam.rules.pa.js (added) (history)

Diff [purge]

Index: trunk/extensions/Narayam/resources/ext.narayam.rules.pa.js
@@ -0,0 +1,170 @@
 2+/**
 3+ * Transliteration regular expression rules table for Gurmukhi script for Punjabi
 4+ * @author Amir E. Aharoni
 5+ * Semi-automatically created from the Hindi transliteration mapping using
 6+ * the Perl substitution:
 7+ * s{(?<deva_letter>[ऀ-ॿ])}{chr(ord($+{deva_letter}) + 0x100)}xmsge;
 8+ * @date 2012-02-11
 9+ * License: GPLv3
 10+ */
 11+
 12+// Normal rules
 13+var rules = [
 14+['ਕ੍h', 'c', 'ਚ੍'],
 15+['\\\\([A-Za-z\\>_~\\.0-9])', '\\\\', '$1'],
 16+
 17+['([ਕ-ਹ]਼?)੍a', '', '$1'],
 18+['([ਕ-ਹ]਼?)੍A', '', '$1ਾ'],
 19+['([ਕ-ਹ]਼?)a', '', '$1ਾ'],
 20+['([ਕ-ਹ]਼?)੍i', '', '$1ਿ'],
 21+['([ਕ-ਹ]਼?)(੍I|ਿi|੆e)', '', '$1ੀ'],
 22+['([ਕ-ਹ]਼?)੍u', '', '$1ੁ'],
 23+['([ਕ-ਹ]਼?)(ੁu|੍U|੊o)', '', '$1ੂ'],
 24+['([ਕ-ਹ]਼?)੍R', '', '$1੃'],
 25+['([ਕ-ਹ]਼?)੃R', '', '$1੄'],
 26+['([ਕ-ਹ]਼?)੍ਲ਼੍l', '', '$1੢'],
 27+['([ਕ-ਹ]਼?)੢l', '', '$1੣'],
 28+['([ਕ-ਹ]਼?)੆\\^', '', '$1੅'],
 29+['([ਕ-ਹ]਼?)੍e', '', '$1ੇ'],
 30+['([ਕ-ਹ]਼?)੍E', '', '$1ੇ'],
 31+['([ਕ-ਹ]਼?)੊\\^', '', '$1੉'],
 32+['([ਕ-ਹ]਼?)i', '', '$1ੈ'],
 33+['([ਕ-ਹ]਼?)੍o', '', '$1ੋ'],
 34+['([ਕ-ਹ]਼?)੍O', '', '$1ੋ'],
 35+['([ਕ-ਹ]਼?)u', '', '$1ੌ'],
 36+['([ਕ-ਹ]਼?)੃a', '', '$1੍਱'],
 37+['([ਕ-ਹ]਼?)੃A', '', '$1੍਱ਾ'],
 38+['([ਕ-ਹ]਼?)੃i', '', '$1੍਱ਿ'],
 39+['([ਕ-ਹ]਼?)੃I', '', '$1੍਱ੀ'],
 40+['([ਕ-ਹ]਼?)੃u', '', '$1੍਱ੁ'],
 41+['([ਕ-ਹ]਼?)੃U', '', '$1੍਱ੂ'],
 42+['([ਕ-ਹ]਼?)੃\\^', '', '$1੍਱੅'],
 43+['([ਕ-ਹ]਼?)੃e', '', '$1੍਱੆'],
 44+['([ਕ-ਹ]਼?)੃E', '', '$1੍਱ੇ'],
 45+['([ਕ-ਹ]਼?)੃o', '', '$1੍਱੊'],
 46+['([ਕ-ਹ]਼?)੃O', '', '$1੍਱ੋ'],
 47+['([ਕ-ਹ]਼?)੃\\~', '', '$1੍਱੍'],
 48+['([ਕ-ਹ])੍\\`', '', '$1਼੍'],
 49+
 50+['ਅa', '', 'ਆ'],
 51+['(਒o|ਉu)', '', 'ਊ'],
 52+['਎\\^', '', '਍'],
 53+['ਅi', '', 'ਐ'],
 54+['ਅ\\^', '', 'ੲ'],
 55+['(ਇi|਎e)', '', 'ਈ'],
 56+['਒\\^', '', '਑'],
 57+['ਅu', '', 'ਔ'],
 58+['਋R', '', '੠'],
 59+['ਲ਼੍l', '', '਌'],
 60+['਌l', '', '੡'],
 61+['ਂ\\^', '', 'ਁ'],
 62+['ਂm', '', 'ਁ'],
 63+['ਂM', '', 'ਁ'],
 64+['ਓM', '', '੐'],
 65+
 66+['ਕ੍h', '', 'ਖ੍'],
 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+['ਜ਼੍h', '', '਴੍'],
 95+['੤\\.', '', '੥'],
 96+
 97+['a', '', 'ਅ'],
 98+['b', '', 'ਬ੍'],
 99+['c', '', 'ਚ੍'],
 100+['d', '', 'ਦ੍'],
 101+['e', '', 'ਏ'],
 102+['f', '', 'ਫ੍'],
 103+['F', '', 'ਫ਼੍'],
 104+['g', '', 'ਗ੍'],
 105+['h', '', 'ਹ੍'],
 106+['i', '', 'ਇ'],
 107+['j', '', 'ਜ੍'],
 108+['j', '', 'ਜ਼੍'],
 109+['k', '', 'ਕ੍'],
 110+['l', '', 'ਲ੍'],
 111+['m', '', 'ਮ੍'],
 112+['n', '', 'ਨ੍'],
 113+['o', '', 'ਓ'],
 114+['p', '', 'ਪ੍'],
 115+['q', '', '\u0A51'],
 116+['r', '', 'ਰ੍'],
 117+['s', '', 'ਸ੍'],
 118+['t', '', 'ਤ੍'],
 119+['u', '', 'ਉ'],
 120+['(v|w)', '', 'ਵ੍'],
 121+['x', '', 'ਕ੍਷੍'],
 122+['y', '', 'ਯ੍'],
 123+['(z|Z)', '', '.'],
 124+['A', '', 'ਆ'],
 125+['B', '', 'ਬ੍ਬ੍'],
 126+['C', '', 'ਕ੍ਕ੍'],
 127+['D', '', 'ਡ੍'],
 128+['E', '', '਍'],
 129+//'F', '', 'ਫ੍'],
 130+['G', '', 'ਗ੍ਗ੍'],
 131+['H', '', 'ਃ'],
 132+['I', '', 'ਈ'],
 133+['J', '', 'ਜ੍ਜ੍'],
 134+['K', '', 'ਕ੍ਕ੍'],
 135+['L', '', 'ਲ਼੍'],
 136+['M', '', 'ਂ'],
 137+['N', '', 'ਣ੍'],
 138+['O', '', 'ਓ'],
 139+['P', '', 'ਪ੍ਪ੍'],
 140+//'Q', '', 'ਅ'],
 141+['R', '', '਋'],
 142+['S', '', 'ਸ਼੍'],
 143+['T', '', 'ਟ੍'],
 144+['U', '', 'ਊ'],
 145+['(V|W)', '', 'ਵ੍ਵ੍'],
 146+['X', '', 'ਕ੍਷੍'],
 147+['Y', '', 'ਞ੍'],
 148+//'z', '', 'ਅ'
 149+['0', '', '੦'],
 150+['1', '', '੧'],
 151+['2', '', '੨'],
 152+['3', '', '੩'],
 153+['4', '', '੪'],
 154+['5', '', '੫'],
 155+['6', '', '੬'],
 156+['7', '', '੭'],
 157+['8', '', '੮'],
 158+['9', '', '੯'],
 159+['~', '', '੍'],
 160+['\\.', '', '੤'],
 161+['//', '', '਽'],
 162+['\\`', '', '਼']
 163+];
 164+
 165+jQuery.narayam.addScheme( 'pa', {
 166+ 'namemsg': 'narayam-pa',
 167+ 'extended_keyboard': false,
 168+ 'lookbackLength': 3,
 169+ 'keyBufferLength': 1,
 170+ 'rules': rules
 171+} );
Property changes on: trunk/extensions/Narayam/resources/ext.narayam.rules.pa.js
___________________________________________________________________
Added: svn:eol-style
1172 + native
Index: trunk/extensions/Narayam/Narayam.i18n.php
@@ -44,6 +44,7 @@
4545 'narayam-or' => 'Odiya Transliteration',
4646 'narayam-or-lekhani' => 'Odiya Lekhani',
4747 'narayam-or-inscript' => 'Oriya InScript',
 48+ 'narayam-pa' => 'Gurmukhi Punjabi Transliteration',
4849 'narayam-pa-phonetic' => 'Gurmukhi Punjabi Phonetic',
4950 'narayam-pa-inscript' => 'Gurmukhi Punjabi InScript',
5051 'narayam-sa' => 'Sanskrit Transliteration',
Index: trunk/extensions/Narayam/Narayam.php
@@ -121,6 +121,7 @@
122122 'or-inscript' => 'ext.narayam.rules.or-inscript',
123123 ),
124124 'pa' => array(
 125+ 'pa' => array( 'ext.narayam.rules.pa', 'beta' ),
125126 'pa-inscript' => array( 'ext.narayam.rules.pa-inscript', 'beta' ),
126127 'pa-phonetic' => array( 'ext.narayam.rules.pa-phonetic', 'beta' ),
127128 ),
@@ -241,6 +242,7 @@
242243 'narayam-or',
243244 'narayam-or-lekhani',
244245 'narayam-or-inscript',
 246+ 'narayam-pa',
245247 'narayam-pa-inscript',
246248 'narayam-pa-phonetic',
247249 'narayam-ru-standard',
@@ -380,6 +382,10 @@
381383 'scripts' => 'resources/ext.narayam.rules.or-inscript.js',
382384 'dependencies' => 'ext.narayam.core',
383385 );
 386+$wgResourceModules['ext.narayam.rules.pa'] = $narayamTpl + array(
 387+ 'scripts' => 'resources/ext.narayam.rules.pa.js',
 388+ 'dependencies' => 'ext.narayam.core',
 389+);
384390 $wgResourceModules['ext.narayam.rules.pa-inscript'] = $narayamTpl + array(
385391 'scripts' => 'resources/ext.narayam.rules.pa-inscript.js',
386392 'dependencies' => 'ext.narayam.core',

Follow-up revisions

RevisionCommit summaryAuthorDate
r111275Cleaned up and removed unneeded characters.amire8005:35, 12 February 2012

Status & tagging log