This package has been deprecated

Author message:

Use "gurmukhi-utils" package instead

@shabados/gurmukhi-utils

1.2.0 • Public • Published

@shabados/gurmukhi-utils

General utilities for working with Gurmukhi.

CircleCI npm (scoped) David license

Usage

const { toUnicode, toAscii, firstLetters } = require('gurmukhi-utils')

toUnicode('Koj')    // Returns ਖੋਜ
toAscii('ਖੋਜ')       // Returns Koj
firstLetters('hir hir hir gunI')   // Returns hhhg
firstLetters('ਹਰਿ ਹਰਿ ਹਰਿ ਗੁਨੀ')      // Returns ਹਹਹਗ

Docs


Functions

firstLetters(line, [stripNukta])String

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 (ਜ਼ => ਜ).

toUnicode(text)String

Converts ASCII text used in the GurmukhiAkhar font to Unicode.

transliterate(line)String

Transliterates a line from ASCII Gurmukhi to english. Currently supports the ,, ;, . vishraam characters.

firstLetters(line, [stripNukta]) ⇒ String

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 (ਜ਼ => ਜ).

Kind: global function
Returns: String - The first letters of each word in the provided Gurmukhi line.

Param Type Default Description
line String The line to generate the first letters for.
[stripNukta] Boolean true If true, replaces letters pair bindi (such as ਜ਼) with their equivalent without the bindi (ਜ). Also replaces open oora with closed oora.

Example (Unicode first letters no pair bindi/nukta)

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

Example (Unicode first letters with pair bindi/nukta)

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

Example (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

Example (ASCII first letters with pair bindi/nukta)

firstLetters('iZir&qym sMdUk* drIXw AmIk* ]', false) // => Zsda

toUnicode(text) ⇒ String

Converts ASCII text used in the GurmukhiAkhar font to Unicode.

Kind: global function
Returns: String - A unicode representation of the provided ASCII Gurmukhi string.

Param Type Description
text String The ASCII text to convert.

transliterate(line) ⇒ String

Transliterates a line from ASCII Gurmukhi to english. Currently supports the ,, ;, . vishraam characters.

Kind: global function
Returns: String - The English transliteration of the provided Gurmukhi line.

Param Type Description
line String The Gurmukhi ASCII line to transliterate.

Example

transliterate('hukmI hukmu clwey rwhu ]') // => hukamee hukam chalaae raahu ||

Example

transliterate('BWfw Bwau AMimRqu iqqu Fwil ]') // => bhaa(n)ddaa bhaau anmrit tit ddaal ||

Future

  • Unicode to ASCII

Readme

Keywords

none

Package Sidebar

Install

npm i @shabados/gurmukhi-utils

Weekly Downloads

2

Version

1.2.0

License

GPL-3.0

Unpacked Size

3.33 MB

Total Files

85

Last publish

Collaborators

  • bhajansweet
  • bhajneet
  • harjot1singh
  • shabados-bot