Global

Methods

firstLetters(line, stripNuktaopt) → {String}

Source:
Generates the first letters for a given ASCII or unicode Gurmukhi string. By default, the function will transform letters with bindi to their simple equivalent, for example, zaza to jaja (ਜ਼ => ਜ).
Examples

Unicode first letters no pair bindi/nukta

firstLetters('ਗ਼ੈਰਿ ਹਮਦਿ ਹੱਕ ਨਿਆਇਦ ਬਰ ਜ਼ਬਾਨਮ ਹੀਚ ਗਾਹ') // => ਗਹਹਨਬਜਹਗ

Unicode first letters with pair bindi/nukta

firstLetters('ਗ਼ੈਰਿ ਹਮਦਿ ਹੱਕ ਨਿਆਇਦ ਬਰ ਜ਼ਬਾਨਮ ਹੀਚ ਗਾਹ') // => ਗ਼ਹਹਨਬਜ਼ਹਗ

ASCII first letters no pair bindi/nukta

firstLetters('ijs no ik®pw krih iqin nwmu rqnu pwieAw ]') // => jnkkqnrp
firstLetters('iZir&qym sMdUk drIXw AmIk ]') // => gsdA

ASCII first letters with pair bindi/nukta

firstLetters('iZir&qym sMdUk* drIXw AmIk* ]', false) // => Zsda
Parameters:
Name Type Attributes Default Description
line String The line to generate the first letters for.
stripNukta Boolean <optional>
true If `true`, replaces letters pair bindi (such as ਜ਼) with their equivalent without the bindi (ਜ). Also replaces open oora with closed oora.
Returns:
The first letters of each word in the provided Gurmukhi line.
Type
String

toUnicode(text) → {String}

Source:
Converts ASCII text used in the GurmukhiAkhar font to Unicode.
Parameters:
Name Type Description
text String The ASCII text to convert.
Returns:
A unicode representation of the provided ASCII Gurmukhi string.
Type
String

transliterate(line) → {String}

Source:
Transliterates a line from ASCII Gurmukhi to english. Currently supports the `,`, `;`, `.` vishraam characters.
Examples
transliterate('hukmI hukmu clwey rwhu ]') // => hukamee hukam chalaae raahu ||
transliterate('BWfw Bwau AMimRqu iqqu Fwil ]') // => bhaa(n)ddaa bhaau anmrit tit ddaal ||
Parameters:
Name Type Description
line String The Gurmukhi ASCII line to transliterate.
Returns:
The English transliteration of the provided Gurmukhi line.
Type
String