1 Star 1 Fork 0

Yulv-git / Search-for-Typos

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Search for Typos

Search for typos in code or text, automatically fix some typos. 查找文本或代码中的拼写错误/打字错误,自动修改部分 typos。


1. Features

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.

1.1. repeated English words

Eg: do, see repeated_English_words.txt for more examples.

1.2. repeated Chinese characters

Eg: , see repeated_Chinese_characters.txt for more examples.

1.3. typos of English words/strings

Eg: modle, see typos_English_words_strings.txt for more examples.

1.4. wrong Chinese phrases

Eg: 既使, see wrong_Chinese_phrases.txt for more examples.

1.5. wrong English phrases

Eg: reasoning framework, see wrong_English_phrases.txt for more examples.

1.6. Automatically fix some typos

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.

2. Using

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 ./

3. Search Results

Some examples of search results are as follows:

typos_show1 typos_show2 typos_show3

4. TODO

  • Automatically fix some typos that know the correct spelling.

Contributing

Feel free to create issues or PRs if you have any questions or suggestions.

MIT License Copyright (c) 2022 Yulv-git Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Search for typos in code or text, automatically fix some typos. 查找文本或代码中的拼写错误/打字错误,自动修改部分 typos。【The typos lib is extensible and customizable, and supports regular expressions. typos 库可扩展和定制,支持正则表达式】 展开 收起
Shell
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Shell
1
https://gitee.com/Yulv-git/Search-for-Typos.git
git@gitee.com:Yulv-git/Search-for-Typos.git
Yulv-git
Search-for-Typos
Search-for-Typos
master

搜索帮助