Skip to main content

🇧🇩 Banglish-to-Bangla: Phonetic Smart Converter

PyPI version PyPI Downloads License: MIT Python 3.10+ Tests

An intelligent, rule-based, and dictionary-validated NLP engine designed to convert Romanized Bengali (Banglish) into authentic Bangla Unicode script. Features dynamic vowel-expansion for informal texting/chat shorthand, weighted multi-dictionary validation across 464,000+ words, and an alphabetically sorted curated base dictionary of 2,770+ words covering 80%+ of daily conversational Bengali.


🚀 Key Features

  • Dynamic Vowel-Expansion & Shorthand Recovery: Seamlessly transliterates informal chat shorthand (e.g., tmi → তুমি, vlo → ভালো, kmn → কেমন, amr → আমার, bndhu → বন্ধু, rsta → রাস্তা).
  • Curated 2,770+ Baseline Dictionary: Pre-indexed and alphabetically sorted mapping in data/ben2bn.csv covering top 80%+ everyday Bengali vocabulary.
  • Weighted Multi-Tier Dictionary: Validates candidates against 464,411 words across 4 frequency tiers for maximum accuracy.
  • Modern Glassmorphic Web UI: Responsive web app with live transliteration, history, voice typing, and clipboard utilities.
  • FastAPI Backend: Clean RESTful endpoints (/convert, /stats) for integration into web, mobile, and desktop applications.
  • In-Memory Cache: High-speed session caching (b2b_cache) without disk pollution.
  • PWA & Offline Ready: Service Worker and Web Manifest support for mobile/desktop installability.

💻 Installation & Usage

pip install shobdosearch

Python Usage:

from converter import BanglishConverter

conv = BanglishConverter()
print(conv.convert_sentence("tmi kmn aso? amr vlo lagse."))
# আউটপুট: তুমি কেমন আছো? আমার ভালো লাগছে.

2. Clone the Repository

git clone https://github.com/skhalidmahmud/ShobdoSearch.git
cd ShobdoSearch

This installs required dependencies and launches the local dev server:

python run.py

Open your browser at http://localhost:8080.

3. Using Docker

docker build -t banglish-converter .
docker run -p 8080:8080 banglish-converter

4. Interactive CLI Mode

python converter.py

🧪 Testing & Verification

Run the built-in test suite to verify phonetic accuracy, edge cases, and chat shorthand recovery:

python verify.py

Output:

===========================================
      SHOBDOSEARCH CONVERSION TESTS       
===========================================
 [PASS] ka           -> কা
 [PASS] kha          -> খা
 [PASS] eta          -> এটা
 [PASS] kemon        -> কেমন
 [PASS] ami          -> আমি
 [PASS] tumi         -> তুমি
 [PASS] valo         -> ভালো
 [PASS] shundor      -> সুন্দর
 [PASS] manush       -> মানুষ
 [PASS] ghor         -> ঘর
 ...
-------------------------------------------
Total: 41 | Passed: 41 | Failed: 0
 ALL TESTS PASSED SUCCESSFULLY!

🛠️ API Reference

  • Interactive Documentation: http://localhost:8080/docs
  • Transliterate Endpoint:
    POST /convert
    Content-Type: application/json
    
    {
      "text": "tmi kmn aso? amr khub vlo lagse."
    }
    
    Response:
    {
      "original": "tmi kmn aso? amr khub vlo lagse.",
      "converted": "তুমি কেমন আছো? আমার খুব ভালো লাগছে."
    }
    
  • Stats Endpoint:
    GET /stats
    
    Returns dictionary size, active rules, and baseline mappings count.

📄 License

Distributed under the MIT License. See LICENSE for details.

Metadata

Release files for shobdosearch 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shobdosearch 2.0.1
File Size Uploaded
shobdosearch-2.0.1.tar.gz 2.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for shobdosearch 2.0.1
File Interpreter ABI Platform
shobdosearch-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / shobdosearch-2.0.1.tar.gz

Download URL shobdosearch-2.0.1.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ae9dae01c9385038e08a78afff4593f82a1e84f595ce83b921b89406b3a96872
BLAKE2b-256 checksum
How to use checksums
89917e98e3a301370ec13169f97e8c6db63f4b3edbc9ae2816dc26a3cffff1d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / shobdosearch-2.0.1-py3-none-any.whl

Download URL shobdosearch-2.0.1-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6b22271c9064cc836f6b55672ac81f401bdb7a954e26cdeb43985e4253dad42
BLAKE2b-256 checksum
How to use checksums
2ec17fa178ac8f5156ab6eeffe6c59033384b2db8edf0fe6d8ff13c4d4618d58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

2.0.2

2 release files

This release

2.0.1 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page