这是Headingæ ‡é¢˜
ä½ å¥½Rust世界Bold文本
这是第二行pæ ‡ç¾
A linter and formatter for help you improve copywriting, to correct spaces, punctuations between CJK (Chinese, Japanese, Korean).
Like Eslint, Rubocop, Gofmt ..., AutoCorrect allows us to checking soure code, and output as colorized diff with corrected suggest. You can intergrating to CI (GitLab CI, GitHub Action, Travis CI....) for use to checking the contents in source code. Recognize the file name, and find out the strings and the comment part.
基于 Rust 编写的 CLI å·¥å…·ï¼Œç”¨äºŽã€Œè‡ªåŠ¨çº æ£ã€æˆ–「检查并建议ã€æ–‡æ¡ˆï¼Œç»™ CJK(ä¸æ–‡ã€æ—¥è¯ã€éŸ©è¯ï¼‰ä¸Žè‹±æ–‡æ··å†™çš„场景,补充æ£ç¡®çš„ç©ºæ ¼ï¼ŒåŒæ—¶å°è¯•ä»¥å®‰å…¨çš„æ–¹å¼è‡ªåŠ¨çº æ£æ ‡ç‚¹ç¬¦å·ç‰ç‰ã€‚
类似 ESlintã€Rubocopã€Gofmt ç‰å·¥å…·ï¼ŒAutoCorrect å¯ä»¥ç”¨äºŽ CI 环境,它æä¾› Lint 功能能便æ·çš„检测出项目ä¸æœ‰é—®é¢˜çš„文案,起到统一规范的作用。
支æŒå„ç§ç±»åž‹æºä»£ç 文件支æŒï¼Œèƒ½è‡ªåŠ¨è¯†åˆ«æ–‡ä»¶å,并准确找到å—符串ã€æ³¨é‡Šåšè‡ªåŠ¨çº æ£ã€‚
æ¤æ–¹æ¡ˆæœ€æ—©äºŽ 2013 å¹´ 出现于 Ruby China 的项目,并é€æ¥å®Œå–„规则细节,当å‰å‡†ç¡®çŽ‡è¾ƒé«˜ï¼ˆçº§å°‘æ•°å¼‚å¸¸æƒ…å†µï¼‰ï¼Œä½ å¯ä»¥æ”¾å¿ƒç”¨æ¥è¾…åŠ©ä½ å®Œæ•´è‡ªåŠ¨çº æ£åŠ¨ä½œã€‚
:
in time)..gitignore
or .autocorrectignore
to ignore files that you wants ignore.In your Cargo.toml
toml
[dependencies]
autocorrect = "1.0.0"
Use autocorrect::format
to format plain text.
````rust extern crate autocorrect;
fn main() { println!("{}", autocorrect::format("长桥LongBridge App下载")); // => "长桥 LongBridge App 下载"
println!("{}", autocorrect::format("Ruby 2.7版本第1次å‘布"));
// => "Ruby 2.7 版本第 1 次å‘布"
println!("{}", autocorrect::format("于3月10日开始"));
// => "于 3 月 10 日开始"
println!("{}", autocorrect::format("包装日期为2013年3月10日"));
// => "包装日期为 2013 年 3 月 10 日"
println!("{}", autocorrect::format("全世界已有数百家公å¸åœ¨ç”Ÿäº§çŽ¯å¢ƒä¸ä½¿ç”¨Rust,以达到快速ã€è·¨å¹³å°ã€ä½Žèµ„æºå 用的目的。"));
// => "全世界已有数百家公å¸åœ¨ç”Ÿäº§çŽ¯å¢ƒä¸ä½¿ç”¨ Rust,以达到快速ã€è·¨å¹³å°ã€ä½Žèµ„æºå 用的目的。"
println!("{}", autocorrect::format("æ—¢ã«ã€ä¸–ç•Œä¸ã®æ•°ç™¾ã¨ã„ã†ä¼æ¥ãŒRustを採用ã—ã€é«˜é€Ÿã§ä½Žãƒªã‚½ãƒ¼ã‚¹ã®ã‚¯ãƒã‚¹ãƒ—ラットフォームソリューションを実ç¾ã—ã¦ã„ã¾ã™ã€‚"));
// => "æ—¢ã«ã€ä¸–ç•Œä¸ã®æ•°ç™¾ã¨ã„ã†ä¼æ¥ãŒ Rust を採用ã—ã€é«˜é€Ÿã§ä½Žãƒªã‚½ãƒ¼ã‚¹ã®ã‚¯ãƒã‚¹ãƒ—ラットフォームソリューションを実ç¾ã—ã¦ã„ã¾ã™ã€‚"
println!("{}", autocorrect::format("ì „ 세계 수백 ê°œì˜ íšŒì‚¬ê°€ 프로ë•ì…˜ 환경ì—ì„œ Rust를 사용하여 ë¹ ë¥´ê³ , í¬ë¡œìŠ¤ í”Œëž«í¼ ë° ë‚®ì€ ë¦¬ì†ŒìŠ¤ ì‚¬ìš©ëŸ‰ì„ ë‹¬ì„±í–ˆìŠµë‹ˆë‹¤."));
// => "ì „ 세계 수백 ê°œì˜ íšŒì‚¬ê°€ 프로ë•ì…˜ 환경ì—ì„œ Rust 를 사용하여 ë¹ ë¥´ê³ , í¬ë¡œìŠ¤ í”Œëž«í¼ ë° ë‚®ì€ ë¦¬ì†ŒìŠ¤ ì‚¬ìš©ëŸ‰ì„ ë‹¬ì„±í–ˆìŠµë‹ˆë‹¤."
println!("{}", autocorrect::format("需è¦ç¬¦å·?自动转æ¢å…¨è§’å—符ã€æ•°å—:我们将在16:32分出å‘去CBDä¸å¿ƒ.")
// => "需è¦ç¬¦å·ï¼Ÿè‡ªåŠ¨è½¬æ¢å…¨è§’å—符ã€æ•°å—:我们将在 16:32 分出å‘去 CBD ä¸å¿ƒã€‚"
```
Use autocorrect::format_for
to format html content.
```rust extern crate autocorrect;
fn main() { let html = r#"
ä½ å¥½Rust世界Bold文本
这是第二行pæ ‡ç¾
println!("{}", autocorrect::format_for(html, "html"));
// <article>
// <h1>这是 Heading æ ‡é¢˜</h1>
// <div class="content">
// <p>ä½ å¥½ Rust 世界<strong>Bold 文本</strong></p>
// <p>这是第二行 p æ ‡ç¾</p>
// </div>
// </article>
} ````
This project under MIT license.