All Projects → ricoa → Copywriting Correct

ricoa / Copywriting Correct

中英文文案排版纠正器

Labels

Projects that are alternatives of or similar to Copywriting Correct

Hint
重构到 ---> https://github.com/hustcc/lint-md
Stars: ✭ 30 (-55.22%)
Mutual labels:  chinese
Chinese Write Handling Char Recognition
汉字手写识别
Stars: ✭ 48 (-28.36%)
Mutual labels:  chinese
Rxswift Chinese Documentation
RxSwift 中文文档
Stars: ✭ 1,107 (+1552.24%)
Mutual labels:  chinese
Postman Cn
Postman汉化中文版
Stars: ✭ 965 (+1340.3%)
Mutual labels:  chinese
Trime
同文安卓輸入法平臺3.x/Android-rime/Rime Input Method Engine for Android
Stars: ✭ 1,032 (+1440.3%)
Mutual labels:  chinese
Howhow Cli
💻 竟然連 terminal 都開始業配了嗎? 可 ... 可惡!
Stars: ✭ 50 (-25.37%)
Mutual labels:  chinese
Cnn Question Classification Keras
Chinese Question Classifier (Keras Implementation) on BQuLD
Stars: ✭ 28 (-58.21%)
Mutual labels:  chinese
Localization Zh Cn Plugin
Chinese Localization for Jenkins
Stars: ✭ 65 (-2.99%)
Mutual labels:  chinese
Awesome Gameserver Cn
中文游戏服务器资源大全
Stars: ✭ 1,038 (+1449.25%)
Mutual labels:  chinese
Char rnn lm zh
language model in Chinese,基于Pytorch官方文档实现
Stars: ✭ 57 (-14.93%)
Mutual labels:  chinese
Python Parallel Programming Cookbook Cn
📖《Python Parallel Programming Cookbook》中文版
Stars: ✭ 978 (+1359.7%)
Mutual labels:  chinese
Chinese Xinhua
📙 中华新华字典数据库。包括歇后语,成语,词语,汉字。
Stars: ✭ 8,705 (+12892.54%)
Mutual labels:  chinese
Gpt2 Ml
GPT2 for Multiple Languages, including pretrained models. GPT2 多语言支持, 15亿参数中文预训练模型
Stars: ✭ 1,066 (+1491.04%)
Mutual labels:  chinese
Nlp xiaojiang
自然语言处理(nlp),小姜机器人(闲聊检索式chatbot),BERT句向量-相似度(Sentence Similarity),XLNET句向量-相似度(text xlnet embedding),文本分类(Text classification), 实体提取(ner,bert+bilstm+crf),数据增强(text augment, data enhance),同义句同义词生成,句子主干提取(mainpart),中文汉语短文本相似度,文本特征工程,keras-http-service调用
Stars: ✭ 954 (+1323.88%)
Mutual labels:  chinese
Awesome Cn
awesome项目中文翻译,提升查阅效率
Stars: ✭ 62 (-7.46%)
Mutual labels:  chinese
Rssbot
Lightweight Telegram RSS bot for notifications only. 用于消息通知的轻量级 Telegram RSS 机器人
Stars: ✭ 952 (+1320.9%)
Mutual labels:  chinese
Pime
Develop input methods for Windows easily with Python and node.js
Stars: ✭ 1,051 (+1468.66%)
Mutual labels:  chinese
Unilmchatchitrobot
Unilm for Chinese Chitchat Robot.基于Unilm模型的夸夸式闲聊机器人项目。
Stars: ✭ 67 (+0%)
Mutual labels:  chinese
Typeset
自动修正中文、英文、代码混合排版中的全半角、空格等问题
Stars: ✭ 63 (-5.97%)
Mutual labels:  chinese
Emacs Document
translate emacs documents to Chinese for convenient reference
Stars: ✭ 1,085 (+1519.4%)
Mutual labels:  chinese

copywriting-correct

中英文文案排版纠正器。

项目地址 https://github.com/ricoa/copywriting-correct 演示地址 https://copywriting-correct.ricoo.top

描述

统一中文文案、排版的相关用法,降低团队成员之间的沟通成本,增强网站气质。

比较以下排版:

  • 排版1

LeanCloud数据存储是围绕AVObject进行的.每个AVObject都包含了与JSON兼容的key-value对应的数据。数据是schema-free的,你不需要在每个AVObject上提前指定存在哪些键,只要直接设定对应的key-value即可。 gitHub是一个通过git进行版本控制的软件源代码托管服务,由GitHub公司(曾称Logical Awesome)的开发者Chris Wanstrath、PJ Hyett和Tom Preston-Werner使用Ruby on Rails编写而成。

  • 排版2

LeanCloud 数据存储是围绕 AVObject 进行的。每个 AVObject 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的,你不需要在每个 AVObject 上提前指定存在哪些键,只要直接设定对应的 key-value 即可。 GitHub 是一个通过 Git 进行版本控制的软件源代码托管服务,由 GitHub 公司(曾称 Logical Awesome)的开发者 Chris Wanstrath、PJ Hyett 和 Tom Preston-Werner 使用 Ruby on Rails 编写而成。

很明显,第二种排版中英文有空格,标点符号也使用正确,专有名词使用正确,会让人看起来更舒服,也更专业。 本系统正是基于 中文文案排版指北(简体中文版) 进行纠正,帮助解决中英文混排的排版问题,提高文案可阅读性。

安装

//安装开发中版本
composer require ricoa/copywriting-correct:dev-master

使用

<?php
require_once 'vendor/autoload.php';

use Ricoa\CopyWritingCorrect\CopyWritingCorrectService;

$service=new CopyWritingCorrectService();

$text=$service->correct('在LeanCloud上,数据存储是围绕AVObject进行的。');

注入自己的纠正器

继承 \Ricoa\CopyWritingCorrect\Correctors\Corrector,并实现 handle 方法。例如 ExampleCorrector.php

<?php

class ExampleCorrector extends \Ricoa\CopyWritingCorrect\Correctors\Corrector {

    protected static $corrector=null;

    /**
     * @param string $text
     *
     * @return mixed
     */
    public function handle($text)
    {
        return $text;
    }
}

使用:

<?php
require_once 'vendor/autoload.php';

use Ricoa\CopyWritingCorrect\CopyWritingCorrectService;

$service=new CopyWritingCorrectService();

$service->addCorrectors([ExampleCorrector::class]);//注入纠正器
$service->resetCorrectors([ExampleCorrector::class]);//重置纠正器,也即废弃默认的纠正器

$text=$service->correct('在LeanCloud上,数据存储是围绕AVObject进行的。');

已实现

空格

  1. 中文字符与半角字符(例如英文字符,数字,英文标点符号)间添加空格。
  2. 数字后面跟着英文字符则在数字后添加空格(适用于数字+单位,例如 1 GB)。
  3. 全角标点与其他字符之间不加空格
  4. 希腊字母与中文字符以及数字和英文字符之间添加空格(不在指北内)。

标点符号

  1. 不重复使用中文标点符号(仅!和?),重复时只保留第一个。

全角和半角

  1. 中文以及中文标点符号()》)后使用全角中文标点符号(包括!?。,():;)。
  2. 数字使用半角字符。
  3. 全角转半角(不在指北内)。
[
	'0' , '1' , '2' , '3' , '4' ,
	'5' , '6' , '7' , '8' , '9' ,
	'A' , 'B' , 'C' , 'D' , 'E' ,
	'F' , 'G' , 'H' , 'I' , 'J' ,
	'K' , 'L' , 'M' , 'N' , 'O' ,
	'P' , 'Q' , 'R' , 'S' , 'T' ,
	'U' , 'V' , 'W' , 'X' , 'Y' ,
	'Z' , 'a' , 'b' , 'c' , 'd' ,
	'e' , 'f' , 'g' , 'h' , 'i' ,
	'j' , 'k' , 'l' , 'm' , 'n' ,
	'o' , 'p' , 'q' , 'r' , 's' ,
	't' , 'u' , 'v' , 'w' , 'x' ,
	'y' , 'z' , '-' , ' ' , '/' ,
	'%' , '#' , '@' , '&' , '<' ,
	'>' , '[' , ']' , '{' , '}' ,
	'\' , '|' , '+' , '=' , '_' ,
	'^' , ' ̄' , '`'
];
//转
[
	'0', '1', '2', '3', '4',
	'5', '6', '7', '8', '9',
	'A', 'B', 'C', 'D', 'E',
	'F', 'G', 'H', 'I', 'J',
	'K', 'L', 'M', 'N', 'O',
	'P', 'Q', 'R', 'S', 'T',
	'U', 'V', 'W', 'X', 'Y',
	'Z', 'a', 'b', 'c', 'd',
	'e', 'f', 'g', 'h', 'i',
	'j', 'k', 'l', 'm', 'n',
	'o', 'p', 'q', 'r', 's',
	't', 'u', 'v', 'w', 'x',
	'y', 'z', '-', ' ', '/',
	'%', '#', '@', '&', '<',
	'>', '[', ']', '{', '}',
	'\\','|', '+', '=', '_',
	'^', '~', '`'
];

名词

  1. 专有名词使用正确的大小写(部分名词达成,见 词典

未实现

全角和半角

  1. 遇到完整的英文整句、特殊名词,其內容使用半角标点

改进

有什么新的想法和建议,欢迎提交 issue 或者 Pull Requests

License

基于 MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].