-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Created spellchecker.py in Spell_checker folder #243
Conversation
There was a problem hiding this 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! 👍🏻
There was a problem hiding this comment.
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:
There was a problem hiding this comment.
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 ")
There was a problem hiding this comment.
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
There was a problem hiding this 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()]))
There was a problem hiding this comment.
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())
There was a problem hiding this comment.
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(" "))
There was a problem hiding this comment.
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())
There was a problem hiding this comment.
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👍
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.
There was a problem hiding this comment.
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!
Uh oh!
There was an error while loading. Please reload this page.
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.
Checklist:
Please tick all the boxes that are fulfilled by your Pull Request.
Update index.md
)README.md
, according to the givenREADME_TEMPLATE.