kana-transformer
TypeScript icon, indicating that this package has built-in type declarations

3.5.0 • Public • Published

Kana transformer

logo

NPM Version test NPM License

Switch the language to: Russian

Try out the functionality on the website

With the library, you will be able to:

  • Transform Russian or English syllables into kana
  • Turn kana to the Russian or English alphabet
  • Convert one kana to the other

There is a function to perform each item.

Before using them, see the functions overview for limitations and recommendations. Keeping the recommendations in mind will improve accuracy, and keeping the limitations in mind will prepare you for the shortcomings of the algorithm.

Documentation

Installation

npm install kana-transformer

Default behaviour

  • toKana() understands English, by Hepburn system; returns hiragana
  • fromKana() returns English, by Hepburn system
  • convertKana() converts to hiragana

More details about the customization options are written in functions overview.

Usage examples

import { fromKana, toKana, convertKana } from 'kana-transformer'
//Recommendation: in the first two functions, separate words with a space

fromKana('わたし は じぶん に おちゃ を たてました')
// => 'watashi wa jibun ni ocha o tatemashita'

toKana('watashi wa jibun ni ocha o tatemashita')
// => 'わたし は じぶん に おちゃ を たてました'

convertKana('ワタシハジブンニオチャヲタテマシタ')
// => 'わたしはじぶんにおちゃをたてました'

Contributing

If you have a suggestion for improving the library, feel free to use issues and pull requests.

License

Apache-2.0

Package Sidebar

Install

npm i kana-transformer

Weekly Downloads

6

Version

3.5.0

License

Apache-2.0

Unpacked Size

403 kB

Total Files

25

Last publish

Collaborators

  • 18degrees