This package has been deprecated

Author message:

Package has been renamed to kana-transformer. Please, try it instead.

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

2.2.2 • Public • Published

kana-transcription

NPM Version test NPM License

Switch the language to: Russian

Find out if the library is right for you by trying it out on the website

A mini-library that you can use to:

  • Translate hiragana/katakana to the Russian or English alphabet
  • Transform syllables of Russian or English alphabet to hiragana/katakana
  • 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-transcription

Usage examples

From kana

import { transcriptKana } from 'kana-transcription'

const kanaText = 'わたし は じぶん に おちゃ を たてました'

//Understood in the Hepburn system - by default
const hepburnText = transcriptKana(kanaText)
//hepburnText = 'watashi wa jibun ni ocha o tatemashita'

//Understood in Kunrei-shiki
const kunreiShikiText = transcriptKana(kanaText, 'kunrei-shiki')
//kunreiShikiText = 'watasi wa zibun ni otya o tatemasita'


//Understood in the Polivanov system; for Russian - by default
const polivanovText = transcriptKana(kanaText, 'ru')
//polivanovText = 'ватаси ва дзибун ни отя о татэмасита'

//Understood in a nonstandard-ru system
const nonstandardRuText = transcriptKana(kanaText, 'nonstandard-ru')
//nonstandardRuText = 'ватащи ва джибун ни очя о татэмащита'

To kana

import { transformToKana } from 'kana-transcription'

const hepburnText = 'watashi wa kinoo haha ni daijina tegami o yonda'

//Understood in the Hepburn system - by default
const transformedFromEN = transformToKana(hepburnText)
//transformedFromEN = 'わたし は きのお はは に だいじな てがみ を よんだ'


const polivanovText = 'ватаси ва киноо хаха ни даидзина тэгами о ёнда'

//Understood in the Polivanov system; for Russian - by default
const transformedFromRU = transformToKana(polivanovText, 'ru')
//transformedFromRU = 'わたし は きのお はは に だいじな てがみ を よんだ'

Contributing

If you want to participate in the work on the project, feel free to use issues and pull requests.

License

Apache-2.0

Package Sidebar

Install

npm i kana-transcription

Weekly Downloads

26

Version

2.2.2

License

Apache-2.0

Unpacked Size

772 kB

Total Files

22

Last publish

Collaborators

  • 18degrees