Extension:Narayam

What can this extension do?
Narayam is a Mediawiki extension that helps to add different language input methods for the various text input fields quickly. The primary users of this extension are users from wikis that use non-latin scripts. As of now, typing solution is developed only for few Indic scripts (Malayalam, Tamil, Bengali, Sanskrit, and Hindi). To develop typing solution for your language contact User:Shijualex.

Usage
The primary aim is to allow as user to input text in wiki without the support of any external typing tools.

Download instructions
Download and put Narayam directory from here under  Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php:

Bengali

 * Avro (Phonetic)
 * InScript (Fixed)
 * National Keyboard (Fixed)

Kannada

 * Transliteration
 * InScript

Malayalam

 * Transliteration (Mozhi)
 * InScript (Fixed)

Sanskrit

 * Transliteration (Fixed)
 * InScript (Fixed)

Sinhala

 * Singlish (Partial phonetic)
 * Wijesekara (Fixed)

Tamil

 * Transliteration (Fixed)
 * Tami99 (Fixed)

Developing More Schemes
More input methods can be added by writing scheme data. Scheme should be in a special format, by following that format any one can develop their own input methods.

A scheme consists of rules used for transliteration. A rule is an array of three strings. The first string is a regex that is matched against the input string (the last few characters before the cursor followed by the character the user entered), the second string is a regex that is matched against the end of the key buffer (the last few keys the user pressed), and the third string is the replacement string (may contain placeholders like $1 for subexpressions). You do not need to add $ to the end of either of the regexes so they match at the end, this is done automagically.

The transliteration algorithm processes the rules in the order they are specified, and applies the first rule that matches. For a rule to match, both the first and second regex have to match (the first for the input, the second for the key buffer). Most rules do not use the keybuffer and specify an empty string as the second regex.

The scheme data object must have the following keys:
 * namemsg: Message key for the name of the scheme
 * extended_keyboard: Whether this scheme has an extended ruleset (bool)
 * lookbackLength: Number of characters before the cursor to include when matching the first regex of each rule. This is usually the maximum number of characters a rule regex can match minus one.
 * keyBufferLength: Length of the key buffer. May be zero if not needed
 * rules: Array of rules, which themselves are arrays of three strings.
 * rules_x: Extended ruleset. This is used instead of the normal ruleset when Alt is held. This key is only required if extended_keyboard is true

Let's consider sample parts from Sanskrit Transliteration scheme, since it utilize most features of rules.

In this map

['a', '','अ'],

['b', '','ब्'],

are direct maps, that is, when we type 'a' it will produce