twt­dict, because I love words

Mar 30 2010

I made some­thing recently. Some­thing I wasn’t sure any­one would really care about or use. I’m still not sure about that, actu­ally. But, it seems to be get­ting some pos­i­tive feed­back from those that have stum­bled across it. It’s called twt­dict.

Some­time in the past cou­ple of weeks I was read­ing in Hell’s Kitchen (yes, I read in the bar some­time. The white noise of a bar makes it easy to con­cen­trate) when I came across a word I was unfa­mil­iar with: sybaritic. I’ve since learned that it means “devoted to or marked by plea­sure and lux­ury.” At time though, I didn’t have access to a dic­tio­nary. I don’t have a smart­phone of any kind, so look­ing it up online was not an option. That may not be a big deal for some peo­ple, but, with­out toot­ing my vocab­u­laric horn too much, I don’t often run into words that I either don’t know or can’t rea­son out the def­i­n­i­tion for based on root and/or con­text. When I do, it makes me fur­row my brow and wish my mem­ory were bet­ter so I could look it up later.

That’s when it hit me: What if there was a way that I could tweet the word and have the def­i­n­i­tion sent back to me in a direct mes­sage? Could there be a ser­vice like that avail­able? If not, could I do it? Would any­one care? Why is the sky blue?

When I got home, I looked online for “twit­ter dic­tio­nary” and all I could find were actual Twit­ter dic­tio­nar­ies, lists of Twit­ter terms and trend­ing top­ics. First hur­dle crossed. If I did it, I wouldn’t be step­ping on anyone’s toes.

Next thing to fig­ure out was whether or not I could do it. I already had a domain and web­space, so that was easy. I looked around online and found a sim­ple Twit­ter class for access­ing the Twit­ter API. That part was easy. Next, I needed an API for a dic­tio­nary, to use to look up the word. This took a lit­tle longer. I found an arti­cle some­one say­ing Google had one, but it’d been long since updated with a “don’t use this API, it’s not actu­ally pub­lic” state­ment from Google. I found one for the Cam­bridge dic­tio­nary, but that wasn’t really an API per se, and tended to return a full HTML document.

Then I found Word­nik. They had an actual API. It’s still in alpha but it’s quick and it’s very easy to use. The rest was rel­a­tively easy, just a lot of pars­ing XML and slic­ing and dic­ing strings. Tweet a word, you’ll get a def­i­n­i­tion… most of the time.

There are still some issues. Some of it with my code, some with the Word­nik API. Cur­rently I grab the first def­i­n­i­tion returned by Word­nik. This isn’t always the best def­i­n­i­tion. Take “hope” for instance: n. A slop­ing plain between moun­tain ridges. Not quite the first thing you think of when you think of “hope.” Also, some words only return one def­i­n­i­tion when looked up by the API, or none at all. Word­nik is still work­ing on that end.

It’s not per­fect, but it works. For now. Should it take off and get pop­u­lar, I might run into black­list­ing issues with Twit­ter and/or Word­nik, so that will need to be addressed at some point. Still, it’s been a fun project and I’m def­i­nitely look­ing for­ward to con­tin­u­ing to refine it. And, with any luck, peo­ple out there will find it useful.

4 responses so far

Facebook comments:

  1. Nice work!

  2. […] This post was men­tioned on Twit­ter by John McGrath, Michael How­land. Michael How­land said: I wrote some­thing called “twt­dict, because I love words”. It can be found here: http://is.gd/b7833 […]

  3. You might want to look at my “Twee­t­ionary” that has been under con­struc­tion for some months now.

    http://thewordguy.wordpress.com/tweetionary

    It’s an off­shoot of my daily tweets that pro­vide a word, its def­i­n­i­tion, and an ety­mol­ogy — all under 140 char­ac­ters or less. I’ve always thought a Twitter-based dic­tio­nary ser­vice would be fun — send the word via Twit­ter to the Twee­t­ionary and get a def­i­n­i­tion. Sounds like you are think­ing the same!

    My grow­ing Twee­t­ionary is designed to fit the Twit­ter 140 char­ac­ter limit, so if you wanted to tap into it, it’s sit­ting there and grow­ing at the rate of maybe 15 – 20 words per week (I only have time to post two or three per day).

    Any­how, I’m a lin­guist, not a pro­gram­mer, so I’m not really into the ins and outs of APIs and data­bases, but I could be ;)

  4. Rus­sell: I might indeed look into your Twee­t­ionary, if the words are easy to access. Work blocks wordpress.com so I can’t check it out from here, but I will when I get home.

    And yes, it has been fun. I love that I can get a def­i­n­i­tion for just about any word wher­ever I am, with­out hav­ing to carry around a dic­tio­nary, and (in my case) with­out hav­ing a smart phone with instant-on internet.

Leave a Reply