in this task the ai must correct the word or give the the word which is nearest to it
This is a Python script that implements an auto-correct spelling tool using the enchant library. The tool takes a sentence as input and suggests corrected spellings for each word with spelling errors.
- Corrects spelling errors in a sentence based on a pre-loaded English dictionary.
- Suggests multiple possible corrections for words with multiple possible spellings.
- Handles punctuation and capitalization in input sentences.
- Outputs all possible corrected sentences, if there are multiple possibilities.
- Clone the repository to your local machine.
- Install the pyenchant library using pip install pyenchant.
pip install pyenchant
- Run the script using python autocorrect.ipynb.
- Run the script using python autocorrect.py.
- Enter a sentence with spelling errors.
- The script will suggest corrected spellings for each word with errors.
- If there are multiple possible corrections, the script will output all possible corrected sentences.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.