Giter Club home page Giter Club logo

anvaad-py's Introduction

anvaad-py :: ਅਨੁਵਾਦ-ਪੀਵਾਏ

This is python version of anvaad-js

Hosted on Pypi - anvaad-py

Installation

# pip
pip install anvaad-py //for windows
pip3 install anvaad-py //for mac

API Documentation

Usage

from anvaad_py import unicode

result = unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)

print(result)

// => '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 The string of letters

Examples

from anvaad_py import ascii

result = ascii('AmgAmqmgkp')

print(result)
// => ',065,109,103,065,109,113,109,103,107,112,'

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 letters
  • eng boolean Whether the string is English (optional, default false)
  • simplify boolean Whether to simplify embedded vowels and other characters (eg. E to a, ^ to K)

Examples

from anvaad_py import firstLetters

result = firstLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')

print(result)
// => 'AmgAmqmgkp'

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 letters
  • simplify 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

from anvaad_py import mainLetters

result = mainLetters('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')

print(result)
// => 'Ae ml grsK Ae ml q mr gr k pAr'

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 converted
  • reverse 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

from anvaad_py import unicode

gurmukhiResult = unicode('Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]')

print(f"gurmukhi results: {gurmukhiResult}")
// => 'gurmukhi results: ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥'

Returns string Returns unicode text

from anvaad_py import unicode

unicodeResult = unicode('ਆਇ ਮਿਲੁ ਗੁਰਸਿਖ ਆਇ ਮਿਲੁ ਤੂ ਮੇਰੇ ਗੁਰੂ ਕੇ ਪਿਆਰੇ ॥', True)

print(f"unicode results: {unicodeResult}")
 * // => 'unicode results: Awie imlu gurisK Awie imlu qU myry gurU ky ipAwry ]'

string Returns gurbani akhar ascii text

a 0xharkirat (Harkirat Singh) production.

anvaad-py's People

Contributors

0xharkirat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.