AgideoPinyin
It can convert chinese to pinyin.
Install
gem install agideo-pinyin
Example
AgideoPinyin.full(“上海捷道”) => “shanghaijiedao” AgideoPinyin.full(“上海捷道agideo”) => “shanghaijiedaoagideo” AgideoPinyin.abbr(“上海捷道”) => “shjd” AgideoPinyin.abbr_else(“上海捷道”) => “shanghjd”
“上海捷道”.to_full_py => “shanghaijiedao” “上海捷道”.to_abbr_py => “shjd” “上海捷道”.to_abbr_else_py => “shanghjd”
Copyright © 2011 [robin], released under the MIT license