Skip to content

kurd-cc/kipa-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KIPA

A NPM package to convert Kurdish (Kurmanji) text to IPA phonetics.

Features

  • Instant, no limitations.
  • Auto convert numbers included.

Installation:

  • With npm:
npm install kipa
  • With yarn:
yarn add kipa

Usage:

  • To only get the resulted ipa text:
import Kipa from 'kipa'

let ipa = Kipa.translate_text('dem baş ji bo we!')
console.log(ipa)
| dɛm bɑːʃ ʒɪ boː wɛ |
  • To get more details as an object:
import Kipa from 'kipa'

let ipa = Kipa.get_ipa('dem baş ji bo we hemûyan û 4 kesên din jî!')
console.log(ipa)
{
  resulted_ipa: '| dɛm bɑːʃ ʒɪ boː wɛ hɛmuːjɑːn uː tʃɑːɾ kɛseːn dɪn ʒiː |\n',
  alternatives: [
    {
      word: 'hemûyan',
      inserted_ipa: 'hɛmuːjɑːn',
      alternative_ipa: 'ħɛmuːjɑːn',
      reasons: ['Different accents or positions']
    }
  ]
}

Testing:

You can test with mocha:

npm test