Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 25, 2022. It is now read-only.

Created spellchecker.py in Spell_checker folder #243

Merged
tusharnankani merged 6 commits into Python-World:master from unknown repository Sep 15, 2020
Merged

Created spellchecker.py in Spell_checker folder #243

tusharnankani merged 6 commits into Python-World:master from unknown repository Sep 15, 2020

Conversation

Copy link

@ghost ghost commented Sep 13, 2020
edited by ghost
Loading

Description

A short summary of what is included in your Pull Request.

Fixes #(issue_no)

Replace issue_no in the above line, with the issue related to this PR.

Type of change

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation Update

Checklist:

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

  • I have named my files and folder, according to this project's guidelines.
  • My code follows the style guidelines of this project.
  • My Pull Request has a descriptive title. (not a vague title like Update index.md)
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have created a helpful and easy to understand README.md, according to the given README_TEMPLATE.
  • I have included a requirements.txt file (if external libraries are required.)
  • My changes do not produce any warnings.
  • I have added a working sample/screenshot of the script.

Copy link
Member

@tusharnankani tusharnankani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script works well! 👍🏻

Comment on lines 2 to 3

a = input("Enter the word to be checked:- ") # incorrect spelling
Copy link
Member

@tusharnankani tusharnankani Sep 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a while loop here:

t = 1
while t:

b = TextBlob(a) #correcting the text

# prints the corrected spelling
print("corrected text: "+str(b.correct()))
Copy link
Member

@tusharnankani tusharnankani Sep 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and after line 9, write

t = input("Try Again? 1 : 0 ")

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok...👍👍

Added the changes as requested
@ghost ghost requested a review from tusharnankani September 13, 2020 14:22
Copy link
Member

@tusharnankani tusharnankani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Hariom1509!

I thought of adding some more features!

All of these changes can be compiled in an even better way, using List Comprehensions;

print("Corrected String: " + str([TextBlob(word).correct for word in a.split()]))

Comment on lines +5 to +6
a = input("Enter the word to be checked:- ") # incorrect spelling
print("original text: "+str(a)) #printing original text
Copy link
Member

@tusharnankani tusharnankani Sep 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of asking for a word to be checked, ask for an input string;
Now, split the string, to form a list of words;

words = list(a.split())

Comment on lines +10 to +11
# prints the corrected spelling
print("corrected text: "+str(b.correct()))
Copy link
Member

@tusharnankani tusharnankani Sep 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And finally:

print("Corrected string: " + str(b.join(" "))

Comment on lines +7 to +9

b = TextBlob(a) #correcting the text

Copy link
Member

@tusharnankani tusharnankani Sep 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, you can simply edit this:

b = []
for word in a:
 b.append(TextBlob(word).correct())

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will commit this👍

Copy link
Author

ghost commented Sep 15, 2020

Hey, @tusharnankani I can make these changes but what I think is that we don't need to make such changes and increase the time and space complexity of the program. Even without making such changes, we can enter the input as a sentence and it gives an output correcting all the alphabets of the sentence. You can test the code in that way too. I can just change

word to sentence
scpy

Finally, it is your choice. If you recommend that I should add the code, I won't mind.

Copy link
Member

@tusharnankani tusharnankani left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hariom1509 Alright!

Great then, it solves our problem!
No Worries!

@tusharnankani tusharnankani merged commit 5e9ec79 into Python-World:master Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /