Skip to main content

BanglaDictionary

BanglaDictionary is a Python package that provides a dictionary for the Bengali (Bangla) language. It allows you to retrieve meanings, pronunciations, examples, parts of speech, types, and sources of words in the Bengali language.

Also, It is a package that allows to build dictionary from Bangla and all other contents from a Bangla dictionary. It allows user how to create online dictionary from scratch and use it to other language'

Installation

You can install the BanglaDictionary package using pip:

pip install bangla-dictionary

File Structure

bangla_dictionary/

├── bangla_dictionary/

│   ├── __init__.py

│   ├── dictionary.py

├── data/

│   ├── __init__.py

│   ├── bangla_dictionary_pkl

├── scripts/

│   ├── __init__.py

│   ├── preprocess.py

│   ├── read_pickle.py

│   ├── words.py

│   ├── write_pickle.py

├── tests/

│   ├── __init__.py

│   ├── test_config.py

│   ├── test_dict.py

│   ├── test_runner.py

│   ├── test_suite.py

├── word_details/

│   ├── banglaWords.txt

├── __init__.py

├── .gitignore

├── LICENSE

├── setup.py

├── README.md

└── requirements.txt

Usage

Here's an example of how to use the BanglaDictionary package:

# Create an instance of the BanglaDictionary

from bangla_dictionary.dictionary import BanglaDictionary



bd = BanglaDictionary()



# Get the meaning of a word

meaning = bd.get_meaning("অই")

print(meaning)  # Output: {"২": ["পদ্যে ছন্দের খাতিরে নির্দেশক স্বরবর্ণ 'ঐ' কখনো কখনো 'অই' রুপে ব্যবহৃত হয়", "স্মরণ সম্বোধন ও আক্ষেপাদি সূচক"], "১": ["অদূরে বা সম্মুখবর্তী কোনো কিছু নির্দেশে ", "নির্দিষ্ট", "উল্লিখিত", "সেই"]}



# Get the pronunciation of a word

pronunciation = bd.get_pronunciation("অংগুষ্ঠানা")

print(pronunciation)  # Output: "ওঙ্গুশঠানা"



# Get an example sentence for a word

example = bd.get_example("অকাজ")

print(example)  # Output: "সে হলো অকাজের কাজী।"



# Get the part of speech (POS) of a word

pos = bd.get_pos("অকাট্য")

print(pos)  # Output: "বিণ"



# Get the type of word

word_type = bd.get_type("অঋণ")

print(word_type)  # Output: "অর্থ [অর্থনৈতিক]"



# Get the source of a word

source = bd.get_source("অকাণ্ড")

print(source)  # Output: "ব্যবহারিক বাংলা অভিধান" 
# Get multiple meanings

from bangla_dictionary.dictionary import BanglaDictionary



bd = BanglaDictionary()



meanings = bd.get_multiple_meanings("অংশভাগী", "অংশল", "অংশহারী")

print(meanings)  # Output: {'অংশভাগী': '{"১": ["অংশ পাওয়ার যোগ্য", "অংশীদার"]}', 'অংশল': '{"১": ["বলবান", "বলশালী"]}', 'অংশহারী': '{"১": ["অংশলোপ", "অপহরণ করে এমন"], "২": ["অংশগ্রহণকারী"]}'}



# Get multiple pronunciations

pronunciations = bd.get_multiple_pronunciations("অংশহারী", "অংশাংশ", "অংশানো")

print(pronunciations)  # Output: {"অংশহারী": "অঙ্‌শোহর", "অংশাংশ": "অঙ্‌শাঙ্‌শো", "অংশানো": "অঙ্‌শানো"}



# Get multiple examples

examples = bd.get_multiple_examples("অকল্যান", "অকষ্টবদ্ধ", "অকস্মাৎ")

print(

    examples)  # Output: {"অকল্যান": "অকল্যান এই সুর।", "অকষ্টবদ্ধ": "সাধু বাংলার বাক্য গঠন পদ্ধতি অকষ্টবদ্ধ।", "অকস্মাৎ": "ছেড়েছি সব অকস্মাতের আশা।"}



# Get multiple parts of speech (POS)

pos_list = bd.get_multiple_pos("অকল্যাণকর", "অকল্মষ", "অকস্মাৎ")

print(pos_list)  # Output: {"অকল্যাণকর": "বিণ", "অকল্মষ": "বিণ", "অকস্মাৎ": "ক্রিবিন"}



# Get multiple types

types = bd.get_multiple_types("অকরোটি ", "অঋণী", "অইরান")

print(types)  # Output: {"অকরোটি ": "প্রাণি [প্রাণিবিজ্ঞান]", "অঋণী": "অর্থ [অর্থনৈতিক]", "অইরান": "ফা. [ফারসি]"}



# Get multiple sources

sources = bd.get_multiple_sources("অকরোটি", "অঋণী", "অইরান")

print(

    sources)  # Output: {"অকরোটি": "ব্যবহারিক বাংলা অভিধান", "অঋণী": "ব্যবহারিক বাংলা অভিধান", "অইরান": "ব্যবহারিক বাংলা অভিধান"}

Data Source

The data used by the BanglaDictionary package is sourced from Bangla Dictionary: Bangla Academy- ব্যবহারিক বাংলা অভিধান. The dictionary provides meanings, pronunciations, examples, parts of speech, types, and sources for a wide range of Bengali words.

Contributing

If you find any issues or would like to contribute to the BanglaDictionary package, please feel free to open an issue or submit a pull request on the GitHub repository. Feel free to create issues to contact.

License

The BanglaDictionary package is released under the MIT License. You are free to use, modify, and distribute this package in your own projects.

Metadata

Release files for bangla-dictionary 0.4

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

Source distribution (sdist)

Source distribution for bangla-dictionary 0.4
File Size Uploaded
bangla_dictionary-0.4.tar.gz 4.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for bangla-dictionary 0.4
File Interpreter ABI Platform
bangla_dictionary-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 MB

Release files / bangla_dictionary-0.4.tar.gz

Download URL bangla_dictionary-0.4.tar.gz
Size 4.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3935f5b0026df04f169e4241eaebf51f39d7bb113ef9dd35785a7f877d845f85
BLAKE2b-256 checksum
How to use checksums
9bead86e326596f9f01919e3703baa839864a721369ef07ff990f2542962164d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / bangla_dictionary-0.4-py3-none-any.whl

Download URL bangla_dictionary-0.4-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4f730a1057c4a24031f2874c19bf15987df68b11acbea9ee9ec332f08c431b93
BLAKE2b-256 checksum
How to use checksums
248879b73a9c058fa1e41483744b358d282e34c017d056ae862beea233f5b100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

0.2

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