1

Basically the opposite of the following Find a word's linguistic pronunciation

I had thought of forming my own dictionary but it doesn't seem ideal.

William
  • 7,595
  • 2
  • 22
  • 70
  • opposite of this https://reference.wolfram.com/language/ref/WordData.html – William Oct 18 '22 at 10:17
  • Aahhh, you mean that you have the pronunciation of a word and you want to search for the words with similar pronunciation! Yes, I think you should probably make your own dictionary. Failing that, search the online Wolfram documentation for "homophones" (and similar terms) you might find something useful in the resource repository. – High Performance Mark Oct 18 '22 at 16:04
  • Are you looking to search for words using the IPA as inputs? – IntroductionToProbability Nov 01 '22 at 16:39

1 Answers1

3

Here is one approach that does not rely on the International Phonetic Alphabet or building a dictionary and makes use of built-in functions

wordSoundsLike[wordPronounciation_String] :=
 Module[
  {
   wordSpokenPronounciation = SpeechSynthesize[wordPronounciation],
   closestWordFunction = Nearest[DictionaryLookup[]],
   wordApproximation
   },
  wordApproximation = SpeechRecognize[wordSpokenPronounciation];
  closestWordFunction[wordApproximation]
  ];

It works suprisingly well. On my limited test set SpeechRecognize is the weak point as SpeechSynthesize does a pretty good job. (eg AudioPlay@SpeechSynthesize@"wustersher saws")

Examples


On "easy" words:

wordSoundsLike["eksplane"] (*Explain*)

{"explain"}

wordSoundsLike["kohmodeetea"] (*Commodity*)

{"commodity"}


On "ambiguous" words

wordSoundsLike["fewsha"] (*Fuchsia*)

{"Asia", "curia", "fascia", "fuchsia", "fuse", "fused", "fusee",
"fuses", "fusing", "fusion", "fuss", "fussy", "fustian", "fusty",
"Julia", "Lucia", "Luria", "Musial", "music", "Nubia", "Russia",
"Susie"}

wordSoundsLike["indite"] (*Indict*)

{"indict", "indie", "indite", "innit"}


On "impossible" words ;)

wordSoundsLike["wustersher saws"] (*Worcestershire Sauce*)

{"high-pressure", "statuesque", "thirstiness"}

wordSoundsLike["lester"] (*Leicester*)

{"lest"}