8

I am trying to build a system that accepts text and outputs the phonetic spelling of the words of this text. Any ideas on what libraries can be used in Python and Java?

pacodelumberg
  • 2,214
  • 4
  • 25
  • 32

4 Answers4

3

Check out soundex

http://en.wikipedia.org/wiki/Soundex

Nickle
  • 367
  • 3
  • 5
  • Great answer(never knew about this)! I did a search and found this question that has an example of a python implementation of soundex: http://stackoverflow.com/questions/1562438/could-use-some-help-with-this-soundex-coding – Lostsoul Nov 28 '11 at 22:32
  • I am looking more to obtaining the corresponding phonetic alphabet in text form. – pacodelumberg Nov 30 '11 at 14:01
2

I came across an old python package Raze. It includes a phonetic module with a translation api:

>>> pd = PhoneticDictionary()
>>> pd.spell('Hello world')
... hotel-echo-lima-lima-oscar whiskey-oscar-romeo-lima-delta

It hasn't been updated in a while, but it still works.

Rob Cowie
  • 22,259
  • 6
  • 62
  • 56
1

Are you looking for something akin to the international phonetic alphabet (IPA) or some other phonetic output? If ARPAbet is ok, there is the CMU pronouncing dictionary (http://www.speech.cs.cmu.edu/cgi-bin/cmudict). That'll give the ARPAbet rendering of most words in English. I've written some code that converts the ARPAbet spelling to IPA and post to github if you'd like.

S Kunath
  • 41
  • 1
0

Just try this : http://texttophonetic.appspot.com/

This tool can help you translate english to IPA (to phonetic). You might want to write some code to get the result then save to your database.

salem
  • 9
  • 1