Advertisement
Guest User

Narayam customization example

a guest
Mar 19th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mw.loader.using('ext.narayam.rules.hi', function () {
  2.  
  3. var hi_rules = $.narayam.getScheme( 'hi' ).rules;
  4. var custom_rules = [
  5.         ['([क-ह]़?)् ', '', '$1 '], //full alphabet on space
  6. //place the following above ['([क-ह])्\\`', '', '$1़्'] to override it
  7.         ['(ड)्\\`', '', 'ड़'],
  8.         ['(ढ)्\\`', '', 'ढ़'],
  9.         ['(ज)्\\`', '', 'ज़्'],
  10.         ['(F|f्\\`)', '', 'फ़्'], //this replaces ['F', '', 'फ़्']
  11.         ['(क)्\\`', '', 'क़्'], //merge with ['q', '', 'क़्']?
  12.         ['(ख)्\\`', '', 'ख़्'],
  13.         ['(ग)्\\`', '', 'ग़्'],
  14.         ['(य)्\\`', '', 'य़्'],
  15. //end overriding ones
  16. //z/Z modification, replaces the single rule ['(z|Z)', '', '.']
  17.         ['z', '', 'ज़्'],
  18.         ['Z', '', '.'],
  19. //O correction
  20.         ['([क-ह]़?)्O', '', '$1ॉ'], //replaces ['([क-ह]़?)्O', '', '$1ो']
  21.         ['O', '', 'ऑ'], //replaces ['O', '', 'ओ']
  22. //oo and ee correction
  23.         ['([क-ह]़?)(ुu|्U|ॊo|ोo)', '', '$1ू'], //oo gives ू, replaces ['([क-ह]़?)(ुu|्U|ॊo)', '', '$1ू']
  24.         ['([क-ह]़?)(्I|िi|ॆe|ेe)', '', '$1ी'], //ee gives ी, replaces ['([क-ह]़?)(्I|िi|ॆe)', '', '$1ी']
  25. //q correction
  26.         ['q', '', 'क़्'], //replaces ['q', '', '\u0951'], merge with ['(क)्\\`', '', 'क़्']?
  27. //gY and jY for ज्ञ
  28.         ['([ग्|ज्]़?)्Y', '', 'ज्ञ्']
  29. ];
  30. hi_rules.unshift.apply(hi_rules, custom_rules);
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement