kana-transformer
v3.5.0
Published
Transform kana to en|ru language or vice versa, using specific transliteration system; convert one kana to the other syllabary
Downloads
23
Maintainers
Readme
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
- Functions overview
- Reasons for recommendations and limitations
- Supported transcription/transliteration systems
Installation
npm install kana-transformer
Default behaviour
toKana()
understands English, by Hepburn system; returns hiraganafromKana()
returns English, by Hepburn systemconvertKana()
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.