RESTful Rhyme Dictionary Web Service
For a side project, I needed a simple rhyming web service. Pass in a word, and have it spit out that word’s rhymes. A quick scan of the internet showed the impossible — it didn’t exist! 30 minutes of Python hacking later and the problem was rectified.
http://azarask.in/services/rhyme
The service can take two paramaters: q and callback. The former specifies the word to be rhymed with (self-rhymes excluded), and the later wraps the results in a function callback in JSONP-style. Data is returned in JSON format.
Here are two examples to get you started:
http://azarask.in/services/rhyme/?q=world
["curled", "hurled", "swirled", "twirled", "neworld", "transworld", "unfurled"]
http://azarask.in/services/rhyme/?q=world&callback=hello
hello(["curled", "hurled", "swirled", "twirled", "neworld", "transworld", "unfurled"])
The results are ordered by number of syllables and then alphabetically. If you make something cool, let me know! (I’m thinking about uses for the new canvas-based text APIs).
Easter egg: If you don’t specify any arguments then the service returns the rhymes of a very special word.
RT @azaaza RESTful Rhyme Dictionary Web Service | Follow @azaaza on Twitter | All blog posts
No related posts.
JR
Absolutely awesome. I’ve been sitting on a guitar-related webapp idea for a few months, and will probably get around to building it sometime in the next six or so. I’m bookmarking this for later, ’cause I’m sure it’ll come in handy when that time comes. Thanks, Aza!
JR
(Oh, quick idea – you’re ordering by syllables right now, which is awesome, but how about including the number of syllables in the returned values? You know, something like
[ {"word": "curled", "syllables": 1}, {"word":"unfurled", "syllables": 2}]
, that sort of thing. I imagine that any client service that relies on syllables enough to need this syllables-count for returned rhymes would be able to analyze the words and determine the number of syllables itself, but it still seems like it’d be a good labor-saving step to include that information in the output.)
E
For those too lazy to figure out what the word rhymed when no query is given: fail
Jimmy
hey i don’t remember reading about syntax highlighting (the other one in the services folder) how does it work?
Aza Raskin
@JR: That’s a great idea re doing syllables. When I get some more time I’ll add that.
@Jimmy: I’ll blog about that one soon :)
Demian
Excellent service! I was thinking of making this myself a while back, using Wiktionary, but I wasn’t finding the necessary APIs to get the rhyming words. Can you provide more details on your implementation.
It would be cool to have an auto-complete feature in a word processor – for song writers, poets, etc.
Baishampayan Ghose
Where is the code? :)
chris
> It would be cool to have an auto-complete feature in a
> word processor – for song writers, poets, etc.
+1
Daniel Einspanjer
No snarky error messages for orange or christmas? :)
The engine behind the rhyming doesn’t know how to rhyme Christ (several past tense words using “ced” like “diced”.
Oh, and of course, after finding that Christ had no rhymes, I immediately had to try Chuck Norris of course. Bit of a chuckle on that one. :)
Daniel Einspanjer
christmas isthmus.. nifty. never thought of that.
Alexander Gyoshev
Great stuff, Aza!
How about making an Ubiquity command out of it :-P
Is the Easter egg “grail”? “Fail” sounds too negative…
Dan
http://azarask.in/services/rhyme/?q=orange
[]
:(
Jan
It is somehow implemented in Wiktionary, but not as such an useful tool.
Laurens Holst
The response type is currently text/html though… that should be application/json for the JSON version and one of the Javascript MIME types (e.g. text/javascript) for the ‘JSONP’ :).
And the Vary header says that the response content differs based on the User-Agent header… is that really the case? Probably it should be just Vary: Accept-Encoding.
You could also add caching headers to the response.
And, what about multi-language support? Based on Accept-Language, of course :) (possibly with an URL parameter to override it easily). The rhyming service would be more useful to me if it were Dutch… ;p
Aza Raskin
@Laurens: Good suggestions. Multi-language is harder to do (does rhyming have the same meaning across all languages? I know in Japanese rhyming doesn’t play much of a role at all). I’ll fix the mime-types and headers :)
Laurens Holst
Most likely it works somewhat differently, because the sounds are different. But a generic system with different sets of basic rules and dictionaries should be able to cover quite a number of languages, even if it doesn’t cover the more exotic ones.
Just getting your hands on rule-sets for languages you do not know is the hard part, I guess :). Maybe you know some other languages well enough yourself, or maybe others would like to contribute.
Anyway, it’s just an idea :).
Andy Fisher
q=interrupt – ["corrupt"]
q=corrupt – []
—
q=vapid – ["rapid"]
q=rapid – []
—
q=palance – ["balance"]
q=balance – []
—
q=vallance – ["balance"]
q=balance – []
* Palance & Vallance appear to have no wordly function beyond being surnames.
—
q=applaud, laud, jawed
returns
["broad", "fraud", "abroad"]
When ‘broad’, ‘fraud’, or ‘abroad’ is queried all that is returned is the above list minus whichever word was queried.
—
q=broach
returns
["coach", "roach", "approach"]
Same as above, ‘broach’ is not returned when one of these three words is queried.
Thought this might be helpful if you had noticed any other kinks.
Otherwise, bravo!
I had an idea for a rhyming app just recently.
Is the source dictionary available?
Nortius Maximus
One of those amusing “rhymes” for Chuck Norris is faulty. The accent for that three-syllable word is on the first syllable, and the second syllable is not pronounced with a long O.
Also, no rhymes for Raskin? I’m just askin’.
Jay
Actually such a website does exist – rhymezone.com.
Great work with yours though!
Anand Agarawala
Awesome! This is gonna make writin’ my rhymes so much easier son!
ps, what data source are you using for the actual rhymes?
anand
jr
you are awesome
David
This is pretty fun. Nice work.
DK
Hi Aza. This is a great service you’ve built. I was trying to figure out a way to use your JSON output in Y! Pipes. Is it possible?
pj4533
hey man, I used your service in a Google Wave robot. (Fezziky) If you are on there you can add it at fezzikybot@appspot.com
Still in progress…
Joshua Pritikin
Does it match on letter sequences or phonetically (e.g. soundex)?
httpcatharsis
super-duper
gucci belts
The basis of its mens belts investigation indicates that cheap gucci belts they operate on a sustainable path of poverty, cheap louis vuitton belts for men job security and low wages. The Department cheap desiger belts for Work and Pensions, gucci belts on sale said, with louis vuitton belts cheap five billion people return to work undertaken. The charity said that about one-fifth of the poverty and again and again where people escape from poverty on a temporary basis.
wholesale beads
Not entirely what your article is about