Google spelling revisited

I recently dreamed up a solution to this old problem: I have a spell command on my talker that takes a phrase, checks for it in /usr/share/dict/words, and if it's not there asks Google via Net::Google for a spelling suggestion. The problem is that Google only offers a suggestion if you spell incorrectly; it won't confirm that you spelled something right.

While I've started reading Why Not? How to use everyday ingenuity to solve problems big and small, I came up with the solution (apparently) on my own: ask again with an intentional misspelling. In this case appending an "x" is good enough to kick Google into gear. For example, before, when typing spell johnny mathis, you'd get nothing from Google because it says it's right. Now, when that happens, the program asks Google again, only this time about johnny mathisx, for which Google helpfully suggests johnny mathis. This is the original query, so spell reports Google says you spelled it right the first time.

The only problem is SOAP calls take a very long time compared with other functions on the talker, so doing two of them before getting output is a little harrowing. But I changed it to say "Checking..." before it actually goes to work, so it should be okay.

Comments

comment

You might be able go back to one SOAP call by always using the deliberate misspelling. My guess would be that adding the deliberate misspelling to a word that starts out misspelled would only create a vey few cases where Google gives up, but this is unverified.

comment

This is all well until Johnny Mathis discovers his black roots and renames himself, just as Nat Cole did after being inspired by Martin Luther.

Seriously, adding the x on is a brilliant and simply solution. I love it!

Might you try a q instead, as it’s that much less likely to stumble into a real word? Few words contain a q without a following u in European languages.

comment

Excuse my ignorance but what is your “talker” ?

comment

Talkers are MUDs on which people don’t actually roleplay, but socialize and build toys and games. “There” and Second Life are actually massively multiplayer talkers, rather than “games” per se.