Search for typos in code or text, automatically fix some typos. 查找文本或代码中的拼写错误/打字错误,自动修改部分 typos。
Currently, typos lookup for non-binary files (text files such as .txt and .md, code script files such as .py and .c) are supported. The typos lib is extensible and customizable, and supports regular expressions.
Eg: do
, see repeated_English_words.txt for more examples.
Eg: 的
, see repeated_Chinese_characters.txt for more examples.
Eg: modle
, see typos_English_words_strings.txt for more examples.
Eg: 既使
, see wrong_Chinese_phrases.txt for more examples.
Eg: reasoning framework
, see wrong_English_phrases.txt for more examples.
Eg: acheive
--> achieve
, see auto_fix.txt for more examples.
Disclaimer: Use the auto_fix.sh script only when you are very sure that the typo(s) and target paths you want to modify are accurate and correct. Because batch automatic modification brings convenience, it may also bring wrong modification.
Search all text under the specified directory and its subdirectories for typos.
# Search typos in all files under the ./ folder and its subfolders.
bash ./search_typos.sh ./
# Search typos in all files under the ./ folder and its subfolders exclude typos_lib folder.
bash ./search_typos_exclude_dir.sh ./ typos_lib/
# Search typos in all files under the ./ folder and its subfolders exclude README.md file.
bash ./search_typos_exclude.sh ./ README.md
# Search typos in all files under the ./ folder and its subfolders exclude typos_lib folder and README.md file.
bash ./search_typos_exclude_dir_exclude.sh ./ typos_lib/ README.md
# Automatically fix some typos in all files under the ./ folder and its subfolders.
# Disclaimer: Use the auto_fix.sh script only when you are very sure that the typo(s) and target paths you want to modify are accurate and correct. Because batch automatic modification brings convenience, it may also bring wrong modification.
bash ./auto_fix.sh ./
Some examples of search results are as follows:
Contributing
Feel free to create issues or PRs if you have any questions or suggestions.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。