japanese-kana
v0.1.2
Published
All Japanese japanese-kana
Downloads
25
Readme
japanese-kana
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
kana
string Kana
Examples
kana.getRomajiByKana('キ')
//=> return `ki`
Returns (string | undefined) Romaji
getKanaByRomaji
Get Kana By Romaji
Parameters
romaji
string Romaji
Examples
kana.getKanaByRomaji('mo')
//=> return ["も", "モ"]
Returns Array<Hiragana, Katakana> Kana
getHiraganaByRomaji
Get Hiragana by Romaji
Parameters
romaji
string Romaji
Examples
kana.getHiraganaByRomaji('fu')
//=> return 'ふ'
Returns string Hiragana
getKatakanaByRomaji
Get Katakana by Romaji
Parameters
romaji
string Romaji
Examples
kana.getKatakanaByRomaji('ha')
//=> return 'ハ'
Returns string Katakana
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- 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