File size: 309 Bytes
97208ad
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from autocorrect import Speller

# Initialize the Speller instance from autocorrect
spell = Speller(lang='en')

def correct_spelling(text):
    """Correct spelling using Autocorrect."""
    
    # Correct basic spelling errors using Autocorrect
    corrected_text = spell(text)
    
    return corrected_text