2017 © Pedro Peláez
 

library chinese

Convert Traditional and Simplified Chinese

image

steelywing/chinese

Convert Traditional and Simplified Chinese

  • Monday, September 25, 2017
  • by steely.wing
  • Repository
  • 1 Watchers
  • 10 Stars
  • 275 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 193 % Grown

The README.md

Chinese Conversion

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

Installation

Use Composer

composer require steelywing/chinese

Manually install

  • Clone this repo, (*2)

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

    composer dump-autoload
    

Feature

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

Demo

For more usage, see demo.php, (*4)

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, (*5)

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

Switch to WikiMedia, run the following command in dict folder, (*6)

php import_wikimedia.php

License

MIT, (*7)

WikiMedia License, (*8)

OpenCC License, (*9)

The Versions

25/09 2017

dev-master

9999999-dev

Convert Traditional and Simplified Chinese

  Sources   Download

MIT

by Steely Wing

25/09 2017

0.3.0

0.3.0.0

Convert Traditional and Simplified Chinese

  Sources   Download

MIT

by Steely Wing

22/09 2017

0.2.2

0.2.2.0

Convert Traditional and Simplified Chinese

  Sources   Download

MIT

by Steely Wing

22/09 2017

0.2.1

0.2.1.0

Convert Traditional and Simplified Chinese

  Sources   Download

MIT

by Steely Wing

22/09 2017

0.2.0

0.2.0.0

Convert Traditional and Simplified Chinese

  Sources   Download

MIT

by Steely Wing

22/09 2017

0.1.0

0.1.0.0

Convert Traditional and Simplified Chinese

  Sources   Download

MIT

by Steely Wing