steelywing/chinese 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

steelywing/chinese

最新稳定版本:0.5.3

Composer 安装命令:

composer require steelywing/chinese

包简介

中文繁簡轉換 Convert Traditional and Simplified Chinese

README 文档

README

PHP Chinese Conversion, Simple, Lightweight (v0.2 with WikiMedia Library < 400KB)

Installation

Use Composer

composer require steelywing/chinese

Manually install

  • Clone this repo

    git clone https://github.com/steelywing/PHP-Chinese.git
    
  • Generate autoload.php, run on PHP-Chinese folder

    composer dump-autoload
    

Feature

  • Use WikiMedia or OpenCC library
  • Lightweight
  • 使用最長匹配規則

Demo

For more usage, see demo.php

require_once __DIR__ . '/vendor/autoload.php';

use SteelyWing\Chinese\Chinese;

$chinese = new Chinese();

echo $chinese->to(Chinese::ZH_HANS, '轉成簡體中文'); // 转成简体中文
echo $chinese->to(Chinese::ZH_HANT, '转成繁体中文'); // 轉成繁體中文

Switch library

Switch to OpenCC, run the following command in dict folder

git clone https://github.com/BYVoid/OpenCC.git
php import_opencc.php

Switch to WikiMedia, run the following command in dict folder

php import_wikimedia.php

License

MIT

WikiMedia License

OpenCC License

统计信息

  • 总下载量: 72.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 39
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 39
  • Watchers: 1
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-22