Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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).