4
$\begingroup$

Given two words x and y, I'd like to find the set of all words that rhyme with x and are synonymous with y. Is this possible with WordData or WolframAlpha?

$\endgroup$

2 Answers 2

9
$\begingroup$

Here's a start....

x = "healed";
y = "pay";

Intersection[
 WolframAlpha["synonyms of " <> y, {{"Synonyms:WordData", 1}, "ComputableData"}, InputAssumptions -> {"*MC.%7E-_*WordData-"}], 
 WolframAlpha["rhymes with " <> x, {{"Rhyme:WordData", 1}, "ComputableData"}, 
 PodStates -> {"Rhyme:WordData__More"}, InputAssumptions -> {"*MC.%7E-_*WordData-"}]
]

{yield}

Meh, this isn't exhaustive, but it's as good as W|A can do it seems.

$\endgroup$
2
$\begingroup$

I found that wolfram|Alpha wasn't good enough, by RhymeZone is a great site for this, and they even support near rhymes. Here's an example:

enter image description here

Rhymes[r_] := Rhymes[r] = Module[{url, links, rhy},
    url=StringTemplate["http://www.rhymezone.com/r/rhyme.cgi?Word=`1`&typeofrhyme=perfect&org1=syl&org2=l&org3=y"][r];
    Check[links=Import[url,"Hyperlinks"],Return@$Failed];
    rhy=Flatten[StringCases[#,"http://www.rhymezone.com/r/d="~~w__:>StringReplace[w,"_"->" "]]&/@links];
    Return @ rhy
]

Synonyms[s_] := Synonyms[s] = Module[{url, links, syn},
    url=StringTemplate["http://www.rhymezone.com/r/rhyme.cgi?Word=`1`&typeofrhyme=syn&org1=syl&org2=l&org3=y"][s];
    Check[links=Import[url,"Hyperlinks"],Return@$Failed];
    syn=Flatten[StringCases[#,"http://www.rhymezone.com/r/d="~~w__:>StringReplace[w,"_"->" "]]&/@links];
    Return @ syn
]

RhymesWithXSynonymWithY[x_, y_] := Intersection[Rhymes@x, Synonyms@y]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.