bahai-term-phonemes
v1.1.5
Published
Utility to identify and convert Baha'i terms to IPN compatible phonems for use in TTS engines
Downloads
9
Readme
Bahai-term-phonemes
Simple utility to convert properly formatted HTML/UTF-8 Baha'i terms into IPA phoneme codes for correct pronunciation by TTS engines
Install the interface module into your node project with:
npm install --save bahai-term-phonemes
Functionality
import terms from 'bahai-term-phonemes'
// or
const terms = require('bahai-term-phonemes')
// checks if term is likely a Baha'i transliteration
isPossibleTerm(str)
// translates a word to IPA code in double-brackets
phonemes("‘Abdu’l-Ḥamíd")
// output: "[[@ b d @U ? l ? h @ m i: d]]"
// replaces Baha'i terms in string
parse("Bahá’u’lláh, Whose Mission...")
// output: "[[b @ h A: ? @U ? l l A: h]], Whose Mission..."
// returns ASCII version of string, removing dot-unders, accents and underscores
strip_accents("‘Abdu’l-Ḥamíd")
// output: "'Abdu'l-Hamid"
Demo
Browser jsfiddle demo: https://jsfiddle.net/chadananda/xa7dtvc3/