Giter Club home page Giter Club logo

bijoy2unicode's Introduction

bijoy2unicode

Purpose

Python 3 package for converting Bijoy <=> Unicode (UTF-8) for Bengali/Bangla.

The package is also available via pip.

Version

0.1.1

License

MPL 2.0

Installation

pip install bijoy2unicode

Example

from bijoy2unicode import converter

test = converter.Unicode()
bijoy_text = 'Dfq cv‡k av‡bi kx‡l †ewóZ cvwb‡Z fvmgvb RvZxq dzj kvcjv| Zvi gv_vq cvUMv‡Qi ci¯úi mshy³ wZbwU cvZv Ges Dfh cv‡k `ywU K‡i ZviKv|'

print(bijoy_text)

toPrint=test.convertBijoyToUnicode(bijoy_text)
print(toPrint)
# উভয় পাশে ধানের শীষে বেষ্টিত পানিতে ভাসমান জাতীয় ফুল শাপলা। তার মাথায় পাটগাছের পরস্পর সংযুক্ত তিনটি পাতা এবং উভয পাশে দুটি করে তারকা।

toPrint=test.convertUnicodeToBijoy(toPrint)
print(toPrint)

References:

https://github.com/bahar/BijoyToUnicode

https://github.com/sh-sabbir/UnicodeToBijoy

https://blog.jetbrains.com/pycharm/2017/05/how-to-publish-your-package-on-pypi/

bijoy2unicode's People

Contributors

akibsadmanee avatar mad-fox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bijoy2unicode's Issues

Not Working with Given Bangla Text

bt = 'চৌধুরী বলে দেন আমরা মধ্যস্থতা করতে ব্যর্থ সরকার এ বার যা করার'
bjt = test.convertUnicodeToBijoy(bt)
bjt

Output :


IndexError Traceback (most recent call last)
in ()
1 bt = 'চৌধুরী বলে দেন আমরা মধ্যস্থতা করতে ব্যর্থ সরকার এ বার যা করার'
2 print(len(bt))
----> 3 bjt = test.convertUnicodeToBijoy(bt)
4 bjt

c:\python35\lib\site-packages\bijoy2unicode\converter.py in convertUnicodeToBijoy(self, srcString)
576
577 # make correction
--> 578 srcString = self.reArranceUnicodeTextForASCI(srcString)
579
580 #inv_conversionMap = {v: k for k, v in conversionMap.items()}

c:\python35\lib\site-packages\bijoy2unicode\converter.py in reArranceUnicodeTextForASCI(self, str)
447
448 while True:
--> 449 if self.IsBanglaBanjonborno(util.mbCharAt(str,i+j)) and self.IsBanglaHalant(util.mbCharAt(str,i+j+1)):
450 j+=2
451

c:\python35\lib\site-packages\bijoy2unicode\util.py in mbCharAt(str, i)
12 def mbCharAt(str, i):
13 # return mb_substr(str, i, 1)
---> 14 return str[i]
15
16 # returns the javascript 'substring' method equivalent

IndexError: string index out of range

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.