Archive for the 'twtdict' Category

Bas­ket case

Aug 19 2010 Published by michael under Miscellany,Photography,Writing,twtdict,twtlang

[Yes, I know it’s been 4 months and 3 days since my last post. Such is my rela­tion­ship with writ­ing and blog­ging and such.]

[Edit: Hee. It would seem this is not the first time I’ve had a 4 month break. Ha, I kill me.]

[I still can’t stand the word “blog”, by the way.]

One of the many ways in which I am a bas­ket case is the para­noia that comes from hav­ing peo­ple hang around behind me when I’m sit­ting at a com­puter. This hap­pens most often at work. I tend not to lis­ten to music at work because it’s hard to hear peo­ple com­ing up behind me. “Get one of those cubi­cal mir­rors,” you’re prob­a­bly say­ing, if you’re the type to speak aloud to blog posts. I prob­a­bly would have by now, except I never remem­ber to get one until I’m at work and get­ting that para­noid feel­ing again. Since there is a dis­tinct lack of mir­rors in the vend­ing machines, I’ve yet to pur­chase one.

The sit­u­a­tion is made worse by the fel­low who sits across the… gap… from me. What do you call the space between two cubi­cles through which peo­ple walk? It’s not a hall or a cor­ri­dor. Pas­sage­way? Walk-thru? I have no idea. Any­way, the guy who is across the way from me. I sit with my back to him. This in itself doesn’t make it worse. Who he is makes him worse.

Now, before I begin this, I want to point out that I’m not ageist. Not any­more than any­one still in their 20s any­way, I guess. But, he’s old. He’s near­ing retire­ment and so doesn’t really do much all day except talk to peo­ple. Peo­ple who stop by his cube. Peo­ple who stand out­side his cube and, there­fore, out­side my cube. They stand there and talk. And, like many old peo­ple, he can con­tinue a con­ver­sa­tion long past when it should have ended. He snorts when he laughs. He kind of stut­ters and speaks in a way that makes it seem as if the mus­cles in his jaw don’t work as well as they used to. It’s actu­ally kind of hard to under­stand him some­times. It’s annoying.

I guess all that does kind of make me sound like a dick. Whatever.

The most recent vis­i­tor had some­thing extra to kick up my social anx­i­ety. She was sell­ing candy bars for her son’s something-or-other. I didn’t hear what. I hate when peo­ple do that in an office. Not because I feel that has no place in an office, but because I feel dick­ish when I turn them down. No, I don’t want to buy a candy bar. Or pop­corn. Or a Christ­mas can­dle. Or any­thing else. Yes, I care that you’re rais­ing money for your kid’s school. (Actu­ally, I don’t really, since I don’t have a kid, in that school or any other, but I don’t think I could come out and say that.) I know it’s my right to turn them down and I shouldn’t feel any­thing for doing it, but it’s just latent “what do peo­ple think of me” worry that I’ve not yet man­aged to let go of.

See, this is why I don’t blog much. I start with a coher­ent sort of out­line and by the time I get a few para­graphs in, I’ve lost it. Fuck it. Here’s a bul­let list:

  • twt­lang is no more. Not that any­one really used it. Twit­ter moved away from anony­mous API usage and I didn’t feel like reg­is­ter­ing it.
  • twt­dict, how­ever, is still alive. In fact, twt­dict won big in Wordnik’s 2010 Devel­oper Chal­lenge. I scooped up best in pro­duc­tiv­ity and best in show. See, ideas thought up in a bar can turn into good things.
  • One of the things I pur­chased with my prize money is a Nikon D3000. Because of that, I’ve been using my Flickr account more. Go take a look, if you’re of the mind to do so.
  • I have no idea why this photo has 111 views. There are no com­ments. No tags. No descrip­tion. Not even a par­tic­u­larly inter­est­ing title. I am some­what baffled.
  • I recently bought a scooter, too. It is fun. You should get one.

I guess that’s brings us up to date, in a jar­ring, half-assed sort of way. I can­not say that it won’t be another 4 months and 3 days before I post again. Only time will tell. Only time will tell.

No responses yet

twt­lang: un ser­vice de tra­duc­tion en util­isant Twit­ter et Google.

Apr 16 2010 Published by michael under twtdict,twtlang

I made another Twit­ter… thing. In the tra­di­tion of twt­dict, I give you: twt­lang. What does twt­lang do? I’m glad you asked.

twt­lang mashes up Twit­ter and the Google Trans­late ser­vice. It works pretty much the same way twt­dict does. Send it a phrase, tell it what lan­guage you want it in, and it will send back the trans­la­tion, if it can.

Since a sen­tence is a lit­tle more neb­u­lous than a sin­gle word, I had to change the way the ser­vice parses the tweets. The struc­ture is a lit­tle more impor­tant. Basi­cally, they have to be sent like this:

@twtlang “I would like this in French, please.” fr

You’ll get this in a Direct Message:

Je voudrais que cela en français, s’il vous plaît.

If you tack a @ on the end, you’ll get an @reply instead, just like twtdict.

Obvi­ously there are some lim­i­ta­tions. For one, the Google trans­late ser­vice will detect what lan­guage the request is in, so I only needed to spec­ify the tar­get lan­guage. Unfor­tu­nately, it doesn’t do so well on shorter phrases. I requested a Ger­man trans­la­tion of “shit” and all I got back was “shit.” (Just tried with French and it worked. Merde.) It seems to work bet­ter with longer phrases. I thought about mak­ing a way to spec­ify the ini­tial lan­guage but didn’t want to get too cryp­tic or “code-y” (as in, @twtlang “trans­late this” en>fr). Or maybe I was just lazy. I don’t know. I might change it if necessary.

Also, it does noth­ing for pro­nun­ci­a­tion. So if you want to know how to say “什么他妈的这是否说的?”, you’re on your own. I sup­pose if you are actu­ally in China, you could just show it to some­one, if your phone will dis­play the char­ac­ters. Mine doesn’t dis­play them in text mes­sages. Haven’t tried Opera mobile yet.

Like twt­dict, the ser­vice is based on a cron job that runs every 5 min­utes, to keep from get­ting black­listed by Twit­ter. Also like twt­dict, I’ll apply for whitelist­ing if necessary.

You can find a list of avail­able lan­guages on the twt­lang page. (Inter­est­ingly, if I request a full list of lan­guages from Google, Esperanto is listed, but it doesn’t work, and Esperanto is not listed in the drop down at the Google Trans­late site.) They’re pretty much the stan­dard coun­try codes, so you prob­a­bly already know most of the more com­mon ones.

I don’t really know why I made this, other than I thought it’d be inter­est­ing. I may get some use out of it this sum­mer when I head to Man­i­toulin Island, Ontario, Canada for my grandmother’s 80th birth­day. (She’s not Cana­dian. My fam­ily has a cabin on the island.) I haven’t been there in 14 or 15 years but I think there are some French-speaking Cana­di­ans in the near­est town. Maybe I can use this to ask where the bath­room is.

Où est la salle de bains?

No responses yet

twt­dict, because I love words

Mar 30 2010 Published by michael under twtdict

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