Skip to content

Commit 3452480

Browse files
authored
Add files via upload
This code will help you to correct all your spelling mistakes in english language
0 parents  commit 3452480

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed

auto_correct.ipynb

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"id": "caa81f68",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdout",
11+
"output_type": "stream",
12+
"text": [
13+
"Requirement already satisfied: autocorrect in c:\\users\\saksh\\anaconda3\\lib\\site-packages (2.6.1)\n"
14+
]
15+
}
16+
],
17+
"source": [
18+
"#installing Auto correct to collab\n",
19+
"!pip install autocorrect"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": 2,
25+
"id": "84d81561",
26+
"metadata": {},
27+
"outputs": [],
28+
"source": [
29+
"#importing The Libraries\n",
30+
"from autocorrect import Speller"
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": 3,
36+
"id": "4a035a33",
37+
"metadata": {},
38+
"outputs": [],
39+
"source": [
40+
"# Create an instance/object of the\n",
41+
"spell = Speller (lang='en')"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 4,
47+
"id": "43a49761",
48+
"metadata": {},
49+
"outputs": [
50+
{
51+
"name": "stdout",
52+
"output_type": "stream",
53+
"text": [
54+
"Enter any word:corractoion\n"
55+
]
56+
}
57+
],
58+
"source": [
59+
"# Take input from the user\n",
60+
"word = input (\"Enter any word:\")"
61+
]
62+
},
63+
{
64+
"cell_type": "code",
65+
"execution_count": 5,
66+
"id": "1e919edb",
67+
"metadata": {},
68+
"outputs": [],
69+
"source": [
70+
"# Perform auto-correction\n",
71+
"corrected = spell(word)"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": 6,
77+
"id": "e0e92037",
78+
"metadata": {},
79+
"outputs": [
80+
{
81+
"name": "stdout",
82+
"output_type": "stream",
83+
"text": [
84+
"did you mean to tell :- correction\n"
85+
]
86+
}
87+
],
88+
"source": [
89+
"# Check if the input word is alread\n",
90+
"if corrected == word:\n",
91+
" print(\"The word \",word,\"is spelled correctly.\")\n",
92+
"else:\n",
93+
" print(f\"did you mean to tell :- \",corrected) "
94+
]
95+
},
96+
{
97+
"cell_type": "code",
98+
"execution_count": null,
99+
"id": "c8012327",
100+
"metadata": {},
101+
"outputs": [],
102+
"source": []
103+
}
104+
],
105+
"metadata": {
106+
"kernelspec": {
107+
"display_name": "Python 3 (ipykernel)",
108+
"language": "python",
109+
"name": "python3"
110+
},
111+
"language_info": {
112+
"codemirror_mode": {
113+
"name": "ipython",
114+
"version": 3
115+
},
116+
"file_extension": ".py",
117+
"mimetype": "text/x-python",
118+
"name": "python",
119+
"nbconvert_exporter": "python",
120+
"pygments_lexer": "ipython3",
121+
"version": "3.11.3"
122+
}
123+
},
124+
"nbformat": 4,
125+
"nbformat_minor": 5
126+
}

0 commit comments

Comments
 (0)