Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uiur/pinyin_to_kana
Translate Chinese pinyin to Japanese kana
https://github.com/uiur/pinyin_to_kana
i18n japanese pinyin
Last synced: 1 day ago
JSON representation
Translate Chinese pinyin to Japanese kana
- Host: GitHub
- URL: https://github.com/uiur/pinyin_to_kana
- Owner: uiur
- License: mit
- Created: 2020-02-27T05:18:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-02-29T19:12:16.000Z (over 4 years ago)
- Last Synced: 2024-10-12T19:30:59.621Z (about 1 month ago)
- Topics: i18n, japanese, pinyin
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PinyinToKana
Translate Chinese pinyin to Japanese kana.
Mapping from pinyin to kana is based on the guideline [中国語音節表記ガイドライン 平凡社版](http://cn.heibonsha.co.jp/)
```ruby
PinyinToKana.pinyin_to_kana('xi jin ping')
#=> 'シージンピン'
```You can translate chinese hanzi to kana with [chinese_pinyin](https://github.com/flyerhzm/chinese_pinyin) gem:
```ruby
Pinyin.t('習近平')
#=> "xi jin ping"PinyinToKana.pinyin_to_kana(Pinyin.t('習近平'))
#=> 'シージンピン'
```## Installation
Add this line to your application's Gemfile:
```ruby
gem 'pinyin_to_kana'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install pinyin_to_kana
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).