sjorso/pinyin

Chinese to pinyin converter

1.0.3 2018-07-27 18:13 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