There are still bugs and sometimes the words are not corrected the way we want it. Latter is due to engine choice. Default engine for type-fixer is textblob which is not the strongest one out there. Please feel free to contribute.
Typo Fixer is a command-line tool that corrects typos in text files and directories. It supports various options such as recursive correction, file extension filters, and automatic saving of changes.
- Clone the repository:
git clone https://github.com/yourusername/typo-fixer.git
cd typo-fixer
- Create a virtual environment and activate it:
- For Windows:
python -m venv venv
venv\Scripts\activate
- For Unix-based systems:
python3 -m venv venv
source venv/bin/activate
- Install the required packages
pip3 install -r requirements.txt
- Make it runnable
chmod +x typo_fixer.py
Here are some examples of how to use Typo Fixer:
- Fix typos in a single file:
./typo_fixer.py --file input.txt
- Fix typos in all files in a directory (non-recursive):
./typo_fixer.py --dir path/to/directory
- Fix typos in all files in a directory and its subdirectories (recursive):
./typo_fixer.py --dir path/to/directory -rec
- Fix typos only in files with a specific extension in a directory (non-recursive):
./typo_fixer.py --dir path/to/directory --endsw .extension
- Fix typos only in files with a specific extension in a directory and its subdirectories (recursive):
./typo_fixer.py --dir path/to/directory -rec --endsw .extension
- Automatically save changes without asking for confirmation:
./typo_fixer.py --file input.txt -force
- Choose a different typo correction engine:
./typo_fixer.py --file input.txt --engine textblob
- Export typo report in JSON or CSV format:
./typo_fixer.py --file input.txt --export report.json
./typo_fixer.py --file input.txt --export report.csv
Contributions are welcome! Please feel free to submit a pull request or open an issue on GitHub.