# 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:
```shell
pip install bangla-dictionary
```
## File Structure
```sh
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:
```python
# 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: "ব্যবহারিক বাংলা অভিধান"
```
```python
# 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/bipsec/bangla-dictionary",
"name": "bangla-dictionary",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "python, online bangla_dictionary, bangla bangla_dictionary, bengali bangla_dictionary, bangla_dict, corpus bangla_dictionary, bangla corpus",
"author": "Biplab Kumar Sarkar, Afrar Jahin, Tanveer Azmal, Asif Shusmit",
"author_email": "bip.sec22@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9b/ea/d86e326596f9f01919e3703baa839864a721369ef07ff990f2542962164d/bangla_dictionary-0.4.tar.gz",
"platform": null,
"description": "# BanglaDictionary\r\r\n\r\r\nBanglaDictionary 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.\r\r\nAlso, 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'\r\r\n\r\r\n## Installation\r\r\n\r\r\nYou can install the BanglaDictionary package using pip:\r\r\n\r\r\n```shell\r\r\npip install bangla-dictionary\r\r\n```\r\r\n\r\r\n## File Structure\r\r\n```sh\r\r\nbangla_dictionary/\r\r\n\u251c\u2500\u2500 bangla_dictionary/\r\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\r\n\u2502 \u251c\u2500\u2500 dictionary.py\r\r\n\u251c\u2500\u2500 data/\r\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\r\n\u2502 \u251c\u2500\u2500 bangla_dictionary_pkl\r\r\n\u251c\u2500\u2500 scripts/\r\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\r\n\u2502 \u251c\u2500\u2500 preprocess.py\r\r\n\u2502 \u251c\u2500\u2500 read_pickle.py\r\r\n\u2502 \u251c\u2500\u2500 words.py\r\r\n\u2502 \u251c\u2500\u2500 write_pickle.py\r\r\n\u251c\u2500\u2500 tests/\r\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\r\n\u2502 \u251c\u2500\u2500 test_config.py\r\r\n\u2502 \u251c\u2500\u2500 test_dict.py\r\r\n\u2502 \u251c\u2500\u2500 test_runner.py\r\r\n\u2502 \u251c\u2500\u2500 test_suite.py\r\r\n\u251c\u2500\u2500 word_details/\r\r\n\u2502 \u251c\u2500\u2500 banglaWords.txt\r\r\n\u251c\u2500\u2500 __init__.py\r\r\n\u251c\u2500\u2500 .gitignore\r\r\n\u251c\u2500\u2500 LICENSE\r\r\n\u251c\u2500\u2500 setup.py\r\r\n\u251c\u2500\u2500 README.md\r\r\n\u2514\u2500\u2500 requirements.txt\r\r\n```\r\r\n\r\r\n\r\r\n## Usage\r\r\n\r\r\nHere's an example of how to use the BanglaDictionary package:\r\r\n\r\r\n```python\r\r\n# Create an instance of the BanglaDictionary\r\r\nfrom bangla_dictionary.dictionary import BanglaDictionary\r\r\n\r\r\nbd = BanglaDictionary()\r\r\n\r\r\n# Get the meaning of a word\r\r\nmeaning = bd.get_meaning(\"\u0985\u0987\")\r\r\nprint(meaning) # Output: {\"\u09e8\": [\"\u09aa\u09a6\u09cd\u09af\u09c7 \u099b\u09a8\u09cd\u09a6\u09c7\u09b0 \u0996\u09be\u09a4\u09bf\u09b0\u09c7 \u09a8\u09bf\u09b0\u09cd\u09a6\u09c7\u09b6\u0995 \u09b8\u09cd\u09ac\u09b0\u09ac\u09b0\u09cd\u09a3 '\u0990' \u0995\u0996\u09a8\u09cb \u0995\u0996\u09a8\u09cb '\u0985\u0987' \u09b0\u09c1\u09aa\u09c7 \u09ac\u09cd\u09af\u09ac\u09b9\u09c3\u09a4 \u09b9\u09af\u09bc\", \"\u09b8\u09cd\u09ae\u09b0\u09a3 \u09b8\u09ae\u09cd\u09ac\u09cb\u09a7\u09a8 \u0993 \u0986\u0995\u09cd\u09b7\u09c7\u09aa\u09be\u09a6\u09bf \u09b8\u09c2\u099a\u0995\"], \"\u09e7\": [\"\u0985\u09a6\u09c2\u09b0\u09c7 \u09ac\u09be \u09b8\u09ae\u09cd\u09ae\u09c1\u0996\u09ac\u09b0\u09cd\u09a4\u09c0 \u0995\u09cb\u09a8\u09cb \u0995\u09bf\u099b\u09c1 \u09a8\u09bf\u09b0\u09cd\u09a6\u09c7\u09b6\u09c7 \", \"\u09a8\u09bf\u09b0\u09cd\u09a6\u09bf\u09b7\u09cd\u099f\", \"\u0989\u09b2\u09cd\u09b2\u09bf\u0996\u09bf\u09a4\", \"\u09b8\u09c7\u0987\"]}\r\r\n\r\r\n# Get the pronunciation of a word\r\r\npronunciation = bd.get_pronunciation(\"\u0985\u0982\u0997\u09c1\u09b7\u09cd\u09a0\u09be\u09a8\u09be\")\r\r\nprint(pronunciation) # Output: \"\u0993\u0999\u09cd\u0997\u09c1\u09b6\u09a0\u09be\u09a8\u09be\"\r\r\n\r\r\n# Get an example sentence for a word\r\r\nexample = bd.get_example(\"\u0985\u0995\u09be\u099c\")\r\r\nprint(example) # Output: \"\u09b8\u09c7 \u09b9\u09b2\u09cb \u0985\u0995\u09be\u099c\u09c7\u09b0 \u0995\u09be\u099c\u09c0\u0964\"\r\r\n\r\r\n# Get the part of speech (POS) of a word\r\r\npos = bd.get_pos(\"\u0985\u0995\u09be\u099f\u09cd\u09af\")\r\r\nprint(pos) # Output: \"\u09ac\u09bf\u09a3\"\r\r\n\r\r\n# Get the type of word\r\r\nword_type = bd.get_type(\"\u0985\u098b\u09a3\")\r\r\nprint(word_type) # Output: \"\u0985\u09b0\u09cd\u09a5 [\u0985\u09b0\u09cd\u09a5\u09a8\u09c8\u09a4\u09bf\u0995]\"\r\r\n\r\r\n# Get the source of a word\r\r\nsource = bd.get_source(\"\u0985\u0995\u09be\u09a3\u09cd\u09a1\")\r\r\nprint(source) # Output: \"\u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u09bf\u0995 \u09ac\u09be\u0982\u09b2\u09be \u0985\u09ad\u09bf\u09a7\u09be\u09a8\" \r\r\n\r\r\n```\r\r\n\r\r\n```python\r\r\n# Get multiple meanings\r\r\nfrom bangla_dictionary.dictionary import BanglaDictionary\r\r\n\r\r\nbd = BanglaDictionary()\r\r\n\r\r\nmeanings = bd.get_multiple_meanings(\"\u0985\u0982\u09b6\u09ad\u09be\u0997\u09c0\", \"\u0985\u0982\u09b6\u09b2\", \"\u0985\u0982\u09b6\u09b9\u09be\u09b0\u09c0\")\r\r\nprint(meanings) # Output: {'\u0985\u0982\u09b6\u09ad\u09be\u0997\u09c0': '{\"\u09e7\": [\"\u0985\u0982\u09b6 \u09aa\u09be\u0993\u09af\u09bc\u09be\u09b0 \u09af\u09cb\u0997\u09cd\u09af\", \"\u0985\u0982\u09b6\u09c0\u09a6\u09be\u09b0\"]}', '\u0985\u0982\u09b6\u09b2': '{\"\u09e7\": [\"\u09ac\u09b2\u09ac\u09be\u09a8\", \"\u09ac\u09b2\u09b6\u09be\u09b2\u09c0\"]}', '\u0985\u0982\u09b6\u09b9\u09be\u09b0\u09c0': '{\"\u09e7\": [\"\u0985\u0982\u09b6\u09b2\u09cb\u09aa\", \"\u0985\u09aa\u09b9\u09b0\u09a3 \u0995\u09b0\u09c7 \u098f\u09ae\u09a8\"], \"\u09e8\": [\"\u0985\u0982\u09b6\u0997\u09cd\u09b0\u09b9\u09a3\u0995\u09be\u09b0\u09c0\"]}'}\r\r\n\r\r\n# Get multiple pronunciations\r\r\npronunciations = bd.get_multiple_pronunciations(\"\u0985\u0982\u09b6\u09b9\u09be\u09b0\u09c0\", \"\u0985\u0982\u09b6\u09be\u0982\u09b6\", \"\u0985\u0982\u09b6\u09be\u09a8\u09cb\")\r\r\nprint(pronunciations) # Output: {\"\u0985\u0982\u09b6\u09b9\u09be\u09b0\u09c0\": \"\u0985\u0999\u09cd\u200c\u09b6\u09cb\u09b9\u09b0\", \"\u0985\u0982\u09b6\u09be\u0982\u09b6\": \"\u0985\u0999\u09cd\u200c\u09b6\u09be\u0999\u09cd\u200c\u09b6\u09cb\", \"\u0985\u0982\u09b6\u09be\u09a8\u09cb\": \"\u0985\u0999\u09cd\u200c\u09b6\u09be\u09a8\u09cb\"}\r\r\n\r\r\n# Get multiple examples\r\r\nexamples = bd.get_multiple_examples(\"\u0985\u0995\u09b2\u09cd\u09af\u09be\u09a8\", \"\u0985\u0995\u09b7\u09cd\u099f\u09ac\u09a6\u09cd\u09a7\", \"\u0985\u0995\u09b8\u09cd\u09ae\u09be\u09ce\")\r\r\nprint(\r\r\n examples) # Output: {\"\u0985\u0995\u09b2\u09cd\u09af\u09be\u09a8\": \"\u0985\u0995\u09b2\u09cd\u09af\u09be\u09a8 \u098f\u0987 \u09b8\u09c1\u09b0\u0964\", \"\u0985\u0995\u09b7\u09cd\u099f\u09ac\u09a6\u09cd\u09a7\": \"\u09b8\u09be\u09a7\u09c1 \u09ac\u09be\u0982\u09b2\u09be\u09b0 \u09ac\u09be\u0995\u09cd\u09af \u0997\u09a0\u09a8 \u09aa\u09a6\u09cd\u09a7\u09a4\u09bf \u0985\u0995\u09b7\u09cd\u099f\u09ac\u09a6\u09cd\u09a7\u0964\", \"\u0985\u0995\u09b8\u09cd\u09ae\u09be\u09ce\": \"\u099b\u09c7\u09dc\u09c7\u099b\u09bf \u09b8\u09ac \u0985\u0995\u09b8\u09cd\u09ae\u09be\u09a4\u09c7\u09b0 \u0986\u09b6\u09be\u0964\"}\r\r\n\r\r\n# Get multiple parts of speech (POS)\r\r\npos_list = bd.get_multiple_pos(\"\u0985\u0995\u09b2\u09cd\u09af\u09be\u09a3\u0995\u09b0\", \"\u0985\u0995\u09b2\u09cd\u09ae\u09b7\", \"\u0985\u0995\u09b8\u09cd\u09ae\u09be\u09ce\")\r\r\nprint(pos_list) # Output: {\"\u0985\u0995\u09b2\u09cd\u09af\u09be\u09a3\u0995\u09b0\": \"\u09ac\u09bf\u09a3\", \"\u0985\u0995\u09b2\u09cd\u09ae\u09b7\": \"\u09ac\u09bf\u09a3\", \"\u0985\u0995\u09b8\u09cd\u09ae\u09be\u09ce\": \"\u0995\u09cd\u09b0\u09bf\u09ac\u09bf\u09a8\"}\r\r\n\r\r\n# Get multiple types\r\r\ntypes = bd.get_multiple_types(\"\u0985\u0995\u09b0\u09cb\u099f\u09bf \", \"\u0985\u098b\u09a3\u09c0\", \"\u0985\u0987\u09b0\u09be\u09a8\")\r\r\nprint(types) # Output: {\"\u0985\u0995\u09b0\u09cb\u099f\u09bf \": \"\u09aa\u09cd\u09b0\u09be\u09a3\u09bf [\u09aa\u09cd\u09b0\u09be\u09a3\u09bf\u09ac\u09bf\u099c\u09cd\u099e\u09be\u09a8]\", \"\u0985\u098b\u09a3\u09c0\": \"\u0985\u09b0\u09cd\u09a5 [\u0985\u09b0\u09cd\u09a5\u09a8\u09c8\u09a4\u09bf\u0995]\", \"\u0985\u0987\u09b0\u09be\u09a8\": \"\u09ab\u09be. [\u09ab\u09be\u09b0\u09b8\u09bf]\"}\r\r\n\r\r\n# Get multiple sources\r\r\nsources = bd.get_multiple_sources(\"\u0985\u0995\u09b0\u09cb\u099f\u09bf\", \"\u0985\u098b\u09a3\u09c0\", \"\u0985\u0987\u09b0\u09be\u09a8\")\r\r\nprint(\r\r\n sources) # Output: {\"\u0985\u0995\u09b0\u09cb\u099f\u09bf\": \"\u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u09bf\u0995 \u09ac\u09be\u0982\u09b2\u09be \u0985\u09ad\u09bf\u09a7\u09be\u09a8\", \"\u0985\u098b\u09a3\u09c0\": \"\u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u09bf\u0995 \u09ac\u09be\u0982\u09b2\u09be \u0985\u09ad\u09bf\u09a7\u09be\u09a8\", \"\u0985\u0987\u09b0\u09be\u09a8\": \"\u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u09bf\u0995 \u09ac\u09be\u0982\u09b2\u09be \u0985\u09ad\u09bf\u09a7\u09be\u09a8\"}\r\r\n```\r\r\n\r\r\n\r\r\n## Data Source\r\r\n\r\r\nThe data used by the BanglaDictionary package is sourced from Bangla Dictionary: Bangla Academy- \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u09bf\u0995 \u09ac\u09be\u0982\u09b2\u09be \u0985\u09ad\u09bf\u09a7\u09be\u09a8. The dictionary provides meanings, pronunciations, examples, parts of speech, types, and sources for a wide range of Bengali words.\r\r\n\r\r\n## Contributing\r\r\nIf 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.\r\r\n\r\r\n\r\r\n## License\r\r\nThe BanglaDictionary package is released under the MIT License. You are free to use, modify, and distribute this package in your own projects.\r\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Complete Bangla Dictionary PyPI Module.",
"version": "0.4",
"project_urls": {
"Homepage": "https://github.com/bipsec/bangla-dictionary"
},
"split_keywords": [
"python",
" online bangla_dictionary",
" bangla bangla_dictionary",
" bengali bangla_dictionary",
" bangla_dict",
" corpus bangla_dictionary",
" bangla corpus"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "248879b73a9c058fa1e41483744b358d282e34c017d056ae862beea233f5b100",
"md5": "96e5521cce08bc186abff5d192f0d193",
"sha256": "4f730a1057c4a24031f2874c19bf15987df68b11acbea9ee9ec332f08c431b93"
},
"downloads": -1,
"filename": "bangla_dictionary-0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "96e5521cce08bc186abff5d192f0d193",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4113911,
"upload_time": "2024-12-20T00:46:38",
"upload_time_iso_8601": "2024-12-20T00:46:38.092652Z",
"url": "https://files.pythonhosted.org/packages/24/88/79b73a9c058fa1e41483744b358d282e34c017d056ae862beea233f5b100/bangla_dictionary-0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9bead86e326596f9f01919e3703baa839864a721369ef07ff990f2542962164d",
"md5": "c5f5e7a4de356839f6d980b71da5b4f9",
"sha256": "3935f5b0026df04f169e4241eaebf51f39d7bb113ef9dd35785a7f877d845f85"
},
"downloads": -1,
"filename": "bangla_dictionary-0.4.tar.gz",
"has_sig": false,
"md5_digest": "c5f5e7a4de356839f6d980b71da5b4f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3986804,
"upload_time": "2024-12-20T00:46:43",
"upload_time_iso_8601": "2024-12-20T00:46:43.334226Z",
"url": "https://files.pythonhosted.org/packages/9b/ea/d86e326596f9f01919e3703baa839864a721369ef07ff990f2542962164d/bangla_dictionary-0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 00:46:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bipsec",
"github_project": "bangla-dictionary",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "numpy",
"specs": [
[
"==",
"2.1.1"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "tzdata",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "setuptools",
"specs": []
},
{
"name": "twine",
"specs": []
},
{
"name": "wheel",
"specs": []
}
],
"lcname": "bangla-dictionary"
}