Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homophone generator

Tags:

algorithm

Is there an algorithm for generating homophones?

Input "cypress", output = { cipress, cipres, cypres, sipress, sypress }

like image 729
patrick Avatar asked Nov 09 '10 16:11

patrick


4 Answers

Try It.This Library will generate as you required

npm install homophonizer

Homophonizer

like image 77
GHULAM NABI Avatar answered Sep 27 '22 17:09

GHULAM NABI


I made one. Source code here: https://github.com/evanshort73/homophone

Try it out in your browser at http://evanshort.name/homophone/

Basic idea: Download the CMU Pronouncing Dictionary, and create a file of allowed phoneme substitutions and their costs. Do a depth first search of every possible substitution, backtracking when the partial result is not the beginning of any dictionary word.

like image 37
realguy Avatar answered Sep 27 '22 18:09

realguy


Soundex is the reverse of this - mapping homophones to the same value. If you indexed every word in a dictionary by its Soundex value, then you could do a lookup to find all homophones of a given word.

like image 28
mbeckish Avatar answered Sep 27 '22 18:09

mbeckish


There is a (and I quote..) Homophoner (stiffled giggle) here: http://yacomink.com/homophoner/

It seems to be using YUI

like image 34
Barrie Reader Avatar answered Sep 27 '22 17:09

Barrie Reader