npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

phonemify

v0.0.3

Published

node module to convert text to phonemes

Downloads

911

Readme

phonemify

node module to convert text to phonemes

Install

npm install phonemify

Use

The first and only required parameter is the string to be converted to its phoneme form.

var phonemify = require('phonemify');

var phonemesOfText = phonemify("Hello World!");

output:

HH AH0 - L OW1 W ER1 L D

The second (optional) parameter is the separator between words. This defaults to two spaces.

var phonemify = require('phonemify');

var phonemesOfText = phonemify("Hello World!", "|");

output:

HH AH0 - L OW1|W ER1 L D

Arpabet and Phoneme Representation

Phonemify uses Arpabet to represent phonemes. Here is a quick list of the phonemes and how they are designated:

Phoneme Example Translation
------- ------- -----------
AA      odd     AA D
AE      at      AE T
AH      hut     HH AH T
AO      ought   AO T
AW      cow     K AW
AY      hide    HH AY D
B       be      B IY
CH      cheese  CH IY Z
D       dee     D IY
DH      thee    DH IY
EH      Ed      EH D
ER      hurt    HH ER T
EY      ate     EY T
F       fee     F IY
G       green   G R IY N
HH      he      HH IY
IH      it      IH T
IY      eat     IY T
JH      gee     JH IY
K       key     K IY
L       lee     L IY
M       me      M IY
N       knee    N IY
NG      ping    P IH NG
OW      oat     OW T
OY      toy     T OY
P       pee     P IY
R       read    R IY D
S       sea     S IY
SH      she     SH IY
T       tea     T IY
TH      theta   TH EY T AH
UH      hood    HH UH D
UW      two     T UW
V       vee     V IY
W       we      W IY
Y       yield   Y IY L D
Z       zee     Z IY
ZH      seizure S IY ZH ER

Accuracy

Accuracy will vary depending on a number of factors, but some points to note:

  1. Phonemify translates each word independent of context, i.e. it does not know part of speech and will translate read the same in both "I read the book yesterday" and "I will read the book tomorrow".
  2. Words present in cmudict were translated by a human and should be correct. Words not present in cmudict (primarily slang and proper nouns) are translated using the Navy Research Lab algorithm, which is very good, but there is no gaurantee that any given word is correct.
  3. Typos and misspellings will, of course, lead to unexpected results.