japanese-kana
All Japanese japanese-kana
Last updated 3 years ago by rem .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install japanese-kana 
SYNC missed versions from official npm registry.

japanese-kana

NPM version NPM downloads CircleCI donate

Install

yarn add japanese-kana

CDN: https://unpkg.com/japanese-kana/dist/

Usage

Currently it only supports gojūon, it's nice if you can help with adding dakuon and yōon support.

const kana = require('japanese-kana')

kana.line('ka')
//=> return
[ [ 'か', 'カ' ],
  [ 'き', 'キ' ],
  [ 'く', 'ク' ],
  [ 'け', 'ケ' ],
  [ 'こ', 'コ' ] ]

kana.getRomajiByKana('キ')
//=> return `ki`

kana.getKanaByRomaji('mo')
//=> return ["も", "モ"]

kana.getHiraganaByRomaji('fu')
//=> return 'ふ'

API

line

Get line by first Romaji of each line

Parameters

  • name string The first Romaji of each line

Examples

kana.line('ka')
//=> return
[ [ 'か', 'カ' ],
[ 'き', 'キ' ],
[ 'く', 'ク' ],
[ 'け', 'ケ' ],
[ 'こ', 'コ' ] ]

Returns Array<Array<Hiragana, Katakana>> Kana

getRomajiByKana

Get Romaji By Kana

Parameters

Examples

kana.getRomajiByKana('キ')
//=> return `ki`

Returns (string | undefined) Romaji

getKanaByRomaji

Get Kana By Romaji

Parameters

Examples

kana.getKanaByRomaji('mo')
//=> return ["も", "モ"]

Returns Array<Hiragana, Katakana> Kana

getHiraganaByRomaji

Get Hiragana by Romaji

Parameters

Examples

kana.getHiraganaByRomaji('fu')
//=> return 'ふ'

Returns string Hiragana

getKatakanaByRomaji

Get Katakana by Romaji

Parameters

Examples

kana.getKatakanaByRomaji('ha')
//=> return 'ハ'

Returns string Katakana

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

japanese-kana © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).

egoistian.com · GitHub @egoist · Twitter @rem_rin_rin

Current Tags

  • 0.1.2                                ...           latest (3 years ago)

6 Versions

  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |