sjorso/pinyin

1.0.1 2017-09-24 07:43 UTC

README

Convert Chinese to pinyin

Originally made for subtitletools.com

Install

composer require sjorso/pinyin

Usage

$pinyinConverter = new \SjorsO\Pinyin\Pinyin();
 
// wǒ xiǎng nǐ yǒu gè hěn hǎo de guānyú Lumbergh 
$pinyin = $pinyinConverter->convert('我想你有个很好的关于Lumbergh');
 
// Milton. fāshēng shénmeshì qíng le?
$pinyin = $pinyinConverter->convert('Milton.发生什么事情了?');

Dictionary

the pinyin-characters-array.php file is a parsed version of CC-CEDICT

License

This project is open-sourced software licensed under the MIT license