ndleah / python-mini-project

🙌 Welcome open-source Python mini-project contributions!
MIT License
3.13k stars 1.23k forks source link

Insight Dictionary: Explore Words with Ease #264

Closed vishwas542-ydv closed 4 months ago

vishwas542-ydv commented 5 months ago

Description

These changes collectively enhance the dictionary project by improving error handling, converting it to a user-friendly graphical interface, and adding functionality for handling and suggesting similar words when an exact match is not found.

Fixes #(issue_no)

Type of change

Choosing one or more options from the following as per the nature of your Pull request.

Project

  1. Exception Handling: Added exception handling in the load_data function to manage potential errors when reading the JSON file (e.g., file not found, invalid JSON, unexpected errors).

  2. Path Handling: Corrected the file path handling using raw string literals to avoid SyntaxError due to escape sequences.

  3. Improved translate Function: Modified the translate function to handle different cases (lowercase, title case, uppercase) for word lookups. Ensured the translate function consistently returns a tuple (output, suggestion).

  4. User Suggestions: Implemented logic to suggest the closest matching word if the exact word is not found. Added a GUI button to allow users to search for the suggested word if a close match is found.

  5. GUI Enhancements: Converted the console-based application to a graphical user interface (GUI) using tkinter. Added input validation to ensure users enter a word before attempting a search. Displayed results and suggestions in the GUI, with a button to confirm and search for suggested words.

  6. Code Structure: Organized the code into functions for better readability and maintainability. Loaded the dictionary data once at the beginning and reused it for all searches to improve efficiency.

  7. Functionality Testing: Ensured the application correctly handles both exact matches and close matches, providing appropriate feedback to the user.

Checklist:

Please tick all the boxes that are fulfilled by your Pull Request.

vishwas542-ydv commented 4 months ago

Hi Ndleah

I hope this message finds you well.

I wanted to extend my sincere thanks for merging the changes I made to your repository Ndleah/python-mini-project. I appreciate your prompt review and approval.

Regards, Vishwas Yadav

On Sun, 2 Jun 2024, 7:01 am Leah Nguyen, @.***> wrote:

Merged #264 https://github.com/ndleah/python-mini-project/pull/264 into main.

— Reply to this email directly, view it on GitHub https://github.com/ndleah/python-mini-project/pull/264#event-13010867027, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU2QXFUUOTWTY4Y3WBR2ZMDZFKYLHAVCNFSM6AAAAABH6XTV5SVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGAYTAOBWG4YDENY . You are receiving this because you authored the thread.Message ID: @.***>