Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -174,7 +174,10 @@ def correct_spelling(text):
|
|
| 174 |
corrected_words = []
|
| 175 |
for word in words:
|
| 176 |
corrected_word = spell.correction(word)
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
| 178 |
return ' '.join(corrected_words)
|
| 179 |
|
| 180 |
# Function to rephrase text and replace words with their synonyms while maintaining form
|
|
|
|
| 174 |
corrected_words = []
|
| 175 |
for word in words:
|
| 176 |
corrected_word = spell.correction(word)
|
| 177 |
+
if corrected_word is not None:
|
| 178 |
+
corrected_words.append(corrected_word)
|
| 179 |
+
else:
|
| 180 |
+
corrected_words.append(word) # Keep the original word if correction is None
|
| 181 |
return ' '.join(corrected_words)
|
| 182 |
|
| 183 |
# Function to rephrase text and replace words with their synonyms while maintaining form
|