rny/zhconverter
最新稳定版本:1.0.0
Composer 安装命令:
composer require rny/zhconverter
包简介
convert between Simplified Chinese(zh-Hans) and Traditional Chinese(zh-Hant)
关键字:
README 文档
README
ZhConverter is a simple PHP library to convert between Simplified Chinese(zh-Hans) and Traditional Chinese(zh-Hant). ZhConverter is using WikiMedia ZhConverter.php as convertion table.
For those rquire better convertion quality, the C++ project OpenCC may be considered.
Highlights
- One line code to do the convertion
- Composer ready, PSR-4 compatible.
- PHPUnit tested.
Install
Install ZhConverter using Composer.
$ composer require rny/zhconverter
Usage
use Rny\ZhConverter\ZhConverter;
$text = ZhConverter::zh2hant($text);
$text = ZhConverter::zh2hans($text);
$text = ZhConverter::zh2TW($text);
$text = ZhConverter::zh2HK($text);
$text = ZhConverter::zh2CN($text);
$text = \Rny\ZhConverter\ZhConverter::zh2hant($text);
$text = \Rny\ZhConverter\ZhConverter::zh2hans($text);
$text = \Rny\ZhConverter\ZhConverter::zh2TW($text);
$text = \Rny\ZhConverter\ZhConverter::zh2HK($text);
$text = \Rny\ZhConverter\ZhConverter::zh2CN($text);
Testing
$ composer test
统计信息
- 总下载量: 35.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-30