Screenshot of Contextable

I put together a neat demo of my "context table" idea. To make more efficient use of letters I abbreviated it to Contextable, which also his the nice side effect of being meaningful outside of being installed under an actual table. A brief recap: the idea is to display relevant results from Wikipedia as you talk.

To solve the problem of which words or phrases are meaningful enough to display, I actually ended up using a pretty nifty technique involving Bloom filters. I built a big filter of the million most popular pages on Wikipedia, cut out some common stop words and used that to determine what's worth loading from the Wikipedia API.

I pick an arbitrary phrase size (4, in this case), and look up the next 4 words in the input. If I don't get a match, I try the next 3 words and so on. This means that I get more specific results: "Super Bowl Sunday" instead of "Super Bowl" and "Sunday". Doing that many requests to the API would be way too many, but the Bloom filter can easily handle lots of lookups quickly.

If you're curious, the source is on GitHub. Happy contexting!