A simple command-line tool to check spelling in text files against a word list (dictionary). It identifies potential spelling errors and reports them with line numbers.
- ✅ Check text files against custom or default word list
- ✅ Report misspelled words with their line numbers
- ✅ Simple and intuitive CLI interface
- ✅ Supports custom dictionary files
- ✅ Default English word list included
No additional dependencies required! Uses only Python standard library.
# Clone the repository
git clone https://github.com/sumanth-0/100LinesOfPythonCode.git
cd 100LinesOfPythonCode/1015_mini_spell_checkerpython main.py document.txtpython main.py document.txt custom_dictionary.txt# Create a test file
echo "This is a test documnt with som misspeled words." > test.txt
# Run the spell checker
python main.py test.txtUsing default English word list
Checking spelling in: test.txt
✗ Found 3 potential spelling error(s):
Line 1:
- documnt
- som
- misspeled
Total words checked: 8
Misspelled words: 3
- Loads a word list (custom or default) into memory
- Reads the text file and extracts all words
- Compares each word against the dictionary (case-insensitive)
- Reports any words not found in the dictionary with their line numbers
- Text files: Plain text files (.txt) with any content
- Dictionary files: One word per line, case-insensitive
Contributions are welcome! Please follow the repository's CONTRIBUTING.md guidelines.
This project is part of the 100 Lines of Python Code repository.
Created for Issue #1015 - Mini Spell Checker