Find how to pronounce words by breaking them up into their phones.
Ruby Perl Shell
Switch branches/tags
Nothing to show
Latest commit 2afee80 Jul 7, 2017 @josephwilk josephwilk Merge pull request #36 from gwagener/memory_profiling
Memory profiling


Build Status Coverage Status

Break words up into their syllables and phones.


require 'pronounce'

=> [["M", "AH1", "NG"], ["K", "IY0", "Z"]]

Data and Procedure

Pronunciations are based on the CMUdict database:

The phone list is the ARPAbet subset used by CMUdict.


Monophthongs: AA, AE, AH, AO, EH, IH, IY, UH, UW
Diphthongs: AW, AY, EY, OW, OY
R-colored: ER


Aspirates: HH
Stops: B, D, G, K, P, T
Affricates: CH, JH
Fricatives: DH, F, SH, S, TH, V, Z, ZH
Nasals: M, N, NG
Liquids: L, R
Semivowels: W, Y

CMUdict contains pronunciations of North American English and ARPAbet represents the phonemes of General American English so those are currently the only dialect and accent supported.

Syllables are split by scanning the pronunciation from the start to finish and applying rules of English phonology to determine if the current phone is the start of a new syllable. Because the pronunciations are corpus based rules only need to split valid words, not determine if a word is valid.

Rules are defined by the rule DSL. A rule can return :new_syllable, :no_new_syllable, or :not_applicable indicating that the rule doesn't apply in the context and other rules should be evaluated.


module Pronounce::SyllableRules
  rule :optional_language, 'name of rule' do


Ruby Support

  • MRI 2.1+
  • JRuby
  • Rubinius 2.5.5