A Python utility to translit gurmukhi, and convert it between ascii to unicode with ease! (Python version of anvaad-js)
Project description
anvaad-py :: ਅਨੁਵਾਦ-ਪੀਵਾਏ
This is python version of anvaad-js
Installation
# pip
pip install anvaad-py
API Documentation
Usage
import unicode from anvaad_py
unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)
// => 'Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'
Table of Contents
ascii
Returns a comma-separated string of ascii codes for a string of Gurmukhi characters
Parameters
string
string The string of letters
Examples
ascii('AmgAmqmgkp')
// => ',065,109,103,065,109,113,109,103,107,112,'
Returns string Returns a single string of comma-separated ascii codes
firstLetters
Retrieve the first letter of each word from a string
Parameters
words
string The string from which to get first letterseng
boolean Whether the string is English (optional, defaultfalse
)simplify
boolean Whether to simplify embedded vowels and other characters (eg. E to a, ^ to K)
Examples
firstLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
// => 'AmgAmqmgkp'
Returns string Returns a single string of characters
mainLetters
Removes vowel symbols from a Gurmukhi string
Parameters
words
string The string from which to get main letterssimplify
boolean Whether to simplify embedded vowels/nasal sounds (eg. E to a, ^ to K)simplifyConsonants
boolean Whether to simplify half characters to full characters (eg. R to r)
Examples
mainLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
// => 'Ae ml grsK Ae ml q mr gr k pAr'
Returns string Returns a single string of characters
unicode
Convert Gurmukhi script to Unicode and back again.
Parameters
text
string Gurbani Akhar or Unicode script to be convertedreverse
boolean Whether to convert ASCII to unicode (false by default)simplify
boolean Whether to simplify extended characters to single code points (eg. sæ to ਸ਼ (u0A36), ਸ਼ (u0A38u0A3C) to S) (false by default)
Examples
unicode('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')
// => 'ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥'
Returns string Returns unicode text
* unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)
* // => 'Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'
Returns string Returns gurbani akhar ascii text
a 0xharkirat (Harkirat Singh) production.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for anvaad_py-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e2c476ab224dfaa83b3dfa15b4cfaff24b3029939b62185722365017cb15fea |
|
MD5 | 941a5c4c8363e58b05080015e86bb0a9 |
|
BLAKE2b-256 | 477d921e92e9e9897a82f571fcec02056cdda28a9d50b21406e518952ed4fab6 |