0.4.0 • Published 2 years ago

ipa-jfk v0.4.0

Weekly downloads
9
License
AGPL-3.0-only
Repository
github
Last release
2 years ago

IPA-JFK

IPA narrow transcription of English words in New York City accent

Online Demo Website

Netlify Status

You can lookup words on our hassle-free Demo Website!

Prerequisites

  • Node.js
  • npm
  • Parcel (for demo and deployment usage)

Install CLI

# For cli or global usage:
npm i -g ipa-jfk

# For local usage:
npm i ipa-jfk

Local Demo

Additional instruction for Windows users: Remember to amend scripts.prepare and scripts.start fields in package.json prior to running:

"prepare": "node ./scripts/download.js"
...
"start": "node ./bin/jfk.js"

npm i
npm run demo
# A server will be running at http://localhost:1234

CLI Usage

jfk [--unicode|--html|--latex] [--phonemic] <word> [<phoneme>...]
  • Output format:
    • --unicode: (default) UTF-8 encoded IPA in unicode.
    • --html: HTML entities of IPA in unicode.
    • --latex: LaTeX script for the TIPA package.
  • --phonemic: Disable narrow transcription, only use broad one.
  • <word>: Which word to translate.
  • <phoneme>: The reference phonemes to use.

Library Usage

impotrt * as jfk from 'ipa-jfk';

// Cache the whole database to speed up future lookups
jfk.cacheDatabase();

// Get phonemes (it returns an array)
const [ph] = jfk.queryDatabase('<word>');
// Alternatively, you can supply your own phonemes.

// Get phonetics
// The third parameter is phonemic/phonetic switch.
const ir = jfk.process('<word>', ph, false);

// Output
console.log(jfk.unicode(ir));
console.log(jfk.html(ir));
console.log(jfk.latex(ir));

FAQ

  • How do you get these?

    Phonemes are retrived from The CMU Pronouncing Dictionary. Phonemes are translated into allophones using a fixed set of rules.

  • I don't understand the complex syntax!

    Go back and learn IPA. The real IPA, not simplified ones. Including diacritics.

  • I live in NYC and this is not my accent.

    You may open an issue here, but we are unlikely to change the rules.

  • Too few words available.

    You should blame CMU. Alternatively, use the reference phonemes in ARPAbet format.

  • Some phonemes are totally incorrect.

    Also blame CMU. You may want to override it by using reference phonemes.

  • Syllabification or /æ/-raising incorrect.

    You may want to override it by using hints (undocumented feature). See the source code.

License

This project is licensed under GNU AGPL v3.0 only. (AGPL-3.0-only).