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.
Installation
You can install the BanglaDictionary package using pip:
Usage
Here's an example of how to use the BanglaDictionary package:
# Create an instance of the BanglaDictionary
from BanglaDictionary 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
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. You can contact via email: bip.sec22@gmail.com , afrarjahin@gmail.com
License
The BanglaDictionary package is released under the MIT License. You are free to use, modify, and distribute this package in your own projects.