Ozgur Unlu commited on
Commit
7805c46
·
1 Parent(s): 1694d38

spelling check adjustment

Browse files
Files changed (1) hide show
  1. app.py +4 -16
app.py CHANGED
@@ -198,22 +198,10 @@ def check_spelling(text, spell_checker):
198
  misspelled.add(cleaned)
199
 
200
  if misspelled:
201
- corrections = []
202
- for word in misspelled:
203
- # Get the most likely corrections
204
- candidates = spell_checker.candidates(word)
205
- if candidates:
206
- # Take up to 3 suggestions
207
- suggestions = list(candidates)[:3]
208
- # Only include if we have valid suggestions
209
- if any(sugg.lower() != word.lower() for sugg in suggestions):
210
- corrections.append(f"'{word}' -> suggestions: {', '.join(suggestions)}")
211
-
212
- if corrections:
213
- return {
214
- 'status': 'warning',
215
- 'message': 'Misspelled words found:\n' + '\n'.join(corrections)
216
- }
217
 
218
  return {
219
  'status': 'pass',
 
198
  misspelled.add(cleaned)
199
 
200
  if misspelled:
201
+ return {
202
+ 'status': 'warning',
203
+ 'message': 'Misspelled words found:\n- ' + '\n- '.join(sorted(misspelled))
204
+ }
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
  return {
207
  'status': 'pass',