Home    About    Contact    Subscribe   

Thursday, Mar 26, 2009

Link to BabelFox:
http://elliottandlara.com/babelfox

Christmas Prank

Last December, Lara and I went up to Alaska to spend Christmas with her family. It was going to be my first time meeting one of her brothers, who'd recently returned from a church mission. I had heard stories of pranks done on his other brother-in-law (and last visit I myself had been short-sheeted by another of Lara's brothers), so I knew come Christmas time, it was game on.

Having recently discovered the Firefox add-on "FoxReplace," and knowing that he was an avid reader of right-wing blogs, I came prepared. FoxReplace swaps out words on a web page according to a user-defined list, like a Find and Replace. (Of course, the actual website isn't changed, just what you see of it. If you opened the page in another browser, you wouldn't see the changes.) With another sibling, we came up with a bunch of substitutions, such as "liberal" to "conservative," "American" to "Fascist," and, one of my favorites, "money" to "poo" (try reading the Economist or Wall Street Journal with that substitution turned on).

The prank was first (unintentionally) sprung on my mother-in-law. When she went to check the schedule for the BYUTV Christmas program, she was a little surprised that there wasn't one scheduled...and we giggled when she announced that the Mormon Tabernacle Choir's Hanukkah program would be coming on soon.

We got Lara's brother the next day. It wasn't the liberal/conservative switch either. He was reading a Wikipedia article on some American historical figure, who according to Wikipedia was a "famous nineteenth century Fascist writer." He blinked, clicked on more links, and then really got excited when he came to the entry on "America."

He even emailed The Drudge Report to report a "mass vandalization" of Wikipedia.

I can't remember how the joke was revealed, but our uncontrolled snickering in the background was probably a hint. (When he did find out, he was a really good sport about it.)

"BabelFox" Web Application

However, FoxReplace doesn't have to be just fun and games. Here I present a way to use FoxReplace to complement your study of a foreign language. It's built on the premise that since a lot of learning needs repetition, one can bolster vocabulary in a passive way by hijacking other daily activities--like blogging.

I was actually planning to write my own FoxReplace extension before I found that someone had already done it. Back in November I was thinking about strategies to help retain my Chinese vocabulary that wouldn't significantly alter my schedule. Since I spend a fair amount of time reading news articles and blogs, I thought it would be great to have a program that would insert vocabulary words into web pages, creating a sort of "inline flashcard" experience. For example, if the Washington Post said "Nice weather today," I wanted my web browser to read "Nice 天气 today" [1]. Since 天气 is one isolated word, it doesn't really slow down my English reading speed, but it tells my brain to prioritize this bit of information [2].

You can find my little web app here. I've called it BabelFox, because it is sort of like the famed Babel Fish, except it makes intelligible words less intelligible.

In a nutshell, the app retrieves a Google Spreadsheet [3] and converts it into a FoxReplace XML file, complete with custom regular expressions and formatting. Voila! Every web page you visit now is a potential mine of flashcards. If you forget what a particular word means, putting the cursor over the vocab word will give you its definition and pronunciation--if that's how you've chosen to configure it. Not interested in language learning? You can also use BabelFox to create and manage prank lists like that used on my brother-in-law. Very importantly, BabelFox also allows you to share your list with others without exposing your Google account name [4] or even the original document's URL.

This project is mostly an experiment with XML, regex, and Google Spreadsheets, but I hope that it can also be useful to others. Also, if I have reinvented the wheel with BabelFox, or there is a better solution out there, please let me know [5].

UPDATE: I just found a Firefox project called LanguageBob which is built on the same idea--inserting vocabulary words into web pages that you visit. It looks to better suited for the beginner language learner, and there doesn't seem to be the same fine-tuned control.

--

[1] If this: [天气] looks like this: [??] it probably means that Asian fonts are not installed on your computer. And if this: [天气] should look like this: [天氣], then you're probably from Taiwan.

[2] As awesome as our brains are, they're often described as "limited-capacity processors." Maybe by repeating the stimulus to the brain, you'll convince the filing system to prioritize it for future recall. Or maybe the repetition will cause the brain to de-prioritize it, since it figures it doesn't need to remember information that is always in front of it. Or maybe...I should just stop pretending to know what I'm talking about.

[3] Initially, I began to build a simplified spreadsheet-like interface for creating a vocabulary list for BabelFox. Then I realized--why not utilize Google Docs, since everyone these days has a Google account? Then I didn't have to worry about user management and email addresses, etc.

[4] This was a VERY annoying thing I discovered about Google Docs...the RSS feed from a published spreadsheet totally has one's gmail address exposed! (Although not the other outputs, like txt, xls, etc., as far as I could tell.) Google engineers: C'mon guys!

[5] Last year when I wrote BabelFox, I did try a few searches and found some interesting related projects. If you are learning Japanese, for example, here is a clever and somewhat related Firefox extension.


Comments

Comment Moderation is enabled. Your comment will not appear until approved.
This sounds like an incredibly awesome idea. Now if I can just get someone to make me beginner, intermediate, and advanced vocab lists in several foreign languages ... =)
# Posted by Sammy Larbi    Sunday, Mar 29 2009, 11:58 AM
Hi,
I use foxreplace too. Currently, i create the xml by hand and would be interested in how you created the xml file automatically. Thanks.. Gail
# Posted by Gail    Sunday, Mar 29 2009, 3:07 PM
Hi Gail, thanks for the comment.

The XML is generated using a ColdFusion server-side script. I put the data from Google Spreadsheets into a 2-D array, then its just a simple output loop into an cfm file with an XML cfheader.

You are free to use BabelFox to automate the process, and you can keep your XML output private; just follow the steps on http://elliottandlara.com/babelfox (first create a Google Spreadsheet, provide its published URL in the box at Step 4, and then download the XML file). Please try it out, and let me know what you think!

I just got word from FoxReplace's author that he can add an "import online XML" feature in the next release, and maybe a syncing feature down the road. So it will be even easier...you'll just need to update a Google spreadsheet to manage your FoxReplace set.
# Posted by Elliott    Sunday, Mar 29 2009, 6:34 PM
Dude, that was a sweet prank! I'm taking notes :-)
# Posted by Bryce Goodwin    Thursday, Apr 23 2009, 5:24 AM
@Bryce
Thanks! Just be careful if you do it on a shared computer; its easy to forget about the prank and get confused yourself. ;-)
# Posted by Elliott    Thursday, Apr 23 2009, 3:51 PM
I've been trying to add entries to the FoxReplace XML file by hand, but the results won't import. I've been trying to stick to the format generated by FoxReplace itself, but I can't seem to get it to work. Can anybody point me to the solution.
TIA
# Posted by Shard    Sunday, Aug 02 2009, 6:37 PM
Hi. I processed my sheet (which is rather long) and the resulting .xml file included only the title of the sheet, down in Column A, Row 8. Did I do something wrong?
I've been trying to edit an existing FoxReplace.xml file by hand, adding just the <substitution><substitution> tags ans everything in between, but I can't get FoxReplace to import it.
Any help would be appreciated. Congratulations on your work.
# Posted by Shard    Monday, Aug 03 2009, 3:11 AM
Hi Shard. There are a few things that can break the XML. If you're doing it by hand, I'd suggest starting with a working, bare-bones FoxReplace list and slowly add more entries until it breaks. It's probably a single character throwing you off.

I don't have a ton of time, but i could give it a quick look. You could email me (elliottandlara@gmail.com) your by-hand XML file and the URL to your published Google Doc, and I'll take a look at them both and see if I have any suggestions.
# Posted by Elliott    Tuesday, Aug 04 2009, 12:38 AM



subscribe [RSS] :: designed by elliott :: powered by blogcfc