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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions projects/Spell_checker/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Script Title
<!--Remove the below lines and add yours -->
Here, you can input any word and check if it is having a correct spelling or not.

### Prerequisites
<!--Remove the below lines and add yours -->
First thing which you need to install is textblob library
<!--Install library-->
>pip install textblob
<!--For jupyter nb-->
You need to run this command in your terminal or your ide terminal.
<!--for jp nb-->
If you are using Jupyter Notebook you need to use the below command
<!--for jp nb-->
>import sys
<!--command-->
>!{sys.executable} -m pip install textblob

### How to run the script
<!--Remove the below lines and add yours -->
You can first install the textblob library and then you can run the python script.

## *Author Name*
<!--Remove the below lines and add yours -->
[Hariom1509](https://github.com/Hariom1509)
12 changes: 12 additions & 0 deletions projects/Spell_checker/spell_checker.py
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from textblob import TextBlob # importing textblob library

t = 1
while t:
a = input("Enter the word to be checked:- ") # incorrect spelling
print("original text: "+str(a)) #printing original text
Comment on lines +5 to +6
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())


b = TextBlob(a) #correcting the text

Comment on lines +7 to +9
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👍

# prints the corrected spelling
print("corrected text: "+str(b.correct()))
Comment on lines +10 to +11
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(" "))

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

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