{"id":13814972,"url":"https://github.com/ricoa/copywriting-correct","last_synced_at":"2025-04-09T20:32:11.187Z","repository":{"id":62535677,"uuid":"89251159","full_name":"ricoa/copywriting-correct","owner":"ricoa","description":"中英文文案排版纠正器","archived":false,"fork":false,"pushed_at":"2018-08-21T09:28:30.000Z","size":40,"stargazers_count":76,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T22:24:55.429Z","etag":null,"topics":["chinese","copywriting","copywriting-correct","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-24T14:35:40.000Z","updated_at":"2024-07-03T03:54:26.000Z","dependencies_parsed_at":"2022-11-02T15:30:16.665Z","dependency_job_id":null,"html_url":"https://github.com/ricoa/copywriting-correct","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoa%2Fcopywriting-correct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoa%2Fcopywriting-correct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoa%2Fcopywriting-correct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricoa%2Fcopywriting-correct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricoa","download_url":"https://codeload.github.com/ricoa/copywriting-correct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107221,"owners_count":21048883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chinese","copywriting","copywriting-correct","php"],"created_at":"2024-08-04T04:02:48.655Z","updated_at":"2025-04-09T20:32:11.127Z","avatar_url":"https://github.com/ricoa.png","language":"PHP","funding_links":[],"categories":["PHP","PHP (184)","其他( Miscellaneous )"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\ncopywriting-correct\n\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e中英文文案排版纠正器。\u003c/p\u003e\n\n\u003e 项目地址 https://github.com/ricoa/copywriting-correct\n演示地址 https://copywriting-correct.ricoo.top\n\n# 描述\n\u003e 统一中文文案、排版的相关用法，降低团队成员之间的沟通成本，增强网站气质。\n \n比较以下排版：\n* 排版1\n\u003eLeanCloud数据存储是围绕AVObject进行的.每个AVObject都包含了与JSON兼容的key-value对应的数据。数据是schema-free的，你不需要在每个AVObject上提前指定存在哪些键，只要直接设定对应的key-value即可。\ngitHub是一个通过git进行版本控制的软件源代码托管服务，由GitHub公司（曾称Logical Awesome）的开发者Chris Wanstrath、PJ Hyett和Tom Preston-Werner使用Ruby on Rails编写而成。\n\n* 排版2\n\u003eLeanCloud 数据存储是围绕 AVObject 进行的。每个 AVObject 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的，你不需要在每个 AVObject 上提前指定存在哪些键，只要直接设定对应的 key-value 即可。\n GitHub 是一个通过 Git 进行版本控制的软件源代码托管服务，由 GitHub 公司（曾称 Logical Awesome）的开发者 Chris Wanstrath、PJ Hyett 和 Tom Preston-Werner 使用 Ruby on Rails 编写而成。\n\n很明显，第二种排版中英文有空格，标点符号也使用正确，专有名词使用正确，会让人看起来更舒服，也更专业。\n本系统正是基于 [中文文案排版指北（简体中文版）](https://github.com/mzlogin/chinese-copywriting-guidelines) 进行纠正，帮助解决中英文混排的排版问题，提高文案可阅读性。\n\n# 安装\n```\n//安装开发中版本\ncomposer require ricoa/copywriting-correct:dev-master\n```\n\n# 使用\n```php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\nuse Ricoa\\CopyWritingCorrect\\CopyWritingCorrectService;\n\n$service=new CopyWritingCorrectService();\n\n$text=$service-\u003ecorrect('在LeanCloud上，数据存储是围绕AVObject进行的。');\n\n```\n\n# 注入自己的纠正器\n继承 \\Ricoa\\CopyWritingCorrect\\Correctors\\Corrector，并实现 handle 方法。例如 ExampleCorrector.php\n```php\n\u003c?php\n\nclass ExampleCorrector extends \\Ricoa\\CopyWritingCorrect\\Correctors\\Corrector {\n\n    protected static $corrector=null;\n\n    /**\n     * @param string $text\n     *\n     * @return mixed\n     */\n    public function handle($text)\n    {\n        return $text;\n    }\n}\n```\n使用：\n```php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\nuse Ricoa\\CopyWritingCorrect\\CopyWritingCorrectService;\n\n$service=new CopyWritingCorrectService();\n\n$service-\u003eaddCorrectors([ExampleCorrector::class]);//注入纠正器\n$service-\u003eresetCorrectors([ExampleCorrector::class]);//重置纠正器，也即废弃默认的纠正器\n\n$text=$service-\u003ecorrect('在LeanCloud上，数据存储是围绕AVObject进行的。');\n\n```\n\n# 已实现\n## 空格\n1. 中文字符与[半角字符](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)（例如英文字符，数字，英文标点符号）间添加空格。\n2. 数字后面跟着英文字符则在数字后添加空格（适用于数字+单位，例如 1 GB）。\n3. 全角标点与其他字符之间不加空格\n4. 希腊字母与中文字符以及数字和英文字符之间添加空格（不在指北内）。\n\n## 标点符号\n1. 不重复使用中文标点符号（仅！和？），重复时只保留第一个。\n\n## 全角和半角\n1. 中文以及中文标点符号（```）》```）后使用全角中文标点符号（包括！？。，（）：；）。\n2. 数字使用半角字符。\n3. 全角转半角（不在指北内）。\n```php\n[\n\t'０' , '１' , '２' , '３' , '４' ,\n\t'５' , '６' , '７' , '８' , '９' ,\n\t'Ａ' , 'Ｂ' , 'Ｃ' , 'Ｄ' , 'Ｅ' ,\n\t'Ｆ' , 'Ｇ' , 'Ｈ' , 'Ｉ' , 'Ｊ' ,\n\t'Ｋ' , 'Ｌ' , 'Ｍ' , 'Ｎ' , 'Ｏ' ,\n\t'Ｐ' , 'Ｑ' , 'Ｒ' , 'Ｓ' , 'Ｔ' ,\n\t'Ｕ' , 'Ｖ' , 'Ｗ' , 'Ｘ' , 'Ｙ' ,\n\t'Ｚ' , 'ａ' , 'ｂ' , 'ｃ' , 'ｄ' ,\n\t'ｅ' , 'ｆ' , 'ｇ' , 'ｈ' , 'ｉ' ,\n\t'ｊ' , 'ｋ' , 'ｌ' , 'ｍ' , 'ｎ' ,\n\t'ｏ' , 'ｐ' , 'ｑ' , 'ｒ' , 'ｓ' ,\n\t'ｔ' , 'ｕ' , 'ｖ' , 'ｗ' , 'ｘ' ,\n\t'ｙ' , 'ｚ' , '－' , '　' , '／' ,\n\t'％' , '＃' , '＠' , '＆' , '＜' ,\n\t'＞' , '［' , '］' , '｛' , '｝' ,\n\t'＼' , '｜' , '＋' , '＝' , '＿' ,\n\t'＾' , '￣' , '｀'\n];\n//转\n[\n\t'0', '1', '2', '3', '4',\n\t'5', '6', '7', '8', '9',\n\t'A', 'B', 'C', 'D', 'E',\n\t'F', 'G', 'H', 'I', 'J',\n\t'K', 'L', 'M', 'N', 'O',\n\t'P', 'Q', 'R', 'S', 'T',\n\t'U', 'V', 'W', 'X', 'Y',\n\t'Z', 'a', 'b', 'c', 'd',\n\t'e', 'f', 'g', 'h', 'i',\n\t'j', 'k', 'l', 'm', 'n',\n\t'o', 'p', 'q', 'r', 's',\n\t't', 'u', 'v', 'w', 'x',\n\t'y', 'z', '-', ' ', '/',\n\t'%', '#', '@', '\u0026', '\u003c',\n\t'\u003e', '[', ']', '{', '}',\n\t'\\\\','|', '+', '=', '_',\n\t'^', '~', '`'\n];\n```\n## 名词\n1. 专有名词使用正确的大小写（部分名词达成，见 [词典](https://github.com/NauxLiu/auto-correct/blob/afb60f8685a205adfe33ee342c98cc3e20d33c9e/dicts.php)）\n\n# 未实现\n## 全角和半角\n1. 遇到完整的英文整句、特殊名词，其內容使用半角标点\n\n# 改进\n有什么新的想法和建议，欢迎提交 [issue](https://github.com/ricoa/copywriting-correct/issues) 或者 [Pull Requests](https://github.com/ricoa/copywriting-correct/pulls)。\n\n# License\n基于 [MIT license](http://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricoa%2Fcopywriting-correct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricoa%2Fcopywriting-correct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricoa%2Fcopywriting-correct/lists"}