The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Instant Lookup

Does anyone know how "instant lookup" works? What I mean by "Instant Lookup" is the feature that marks certain 'known' words in instant messangers (most webpages do it too) and when you click on them, you get a definition of the word. It's quite popular these days. I am looking to implement this in C++.

Any ideas? If you know of an open-source project that implements this, that would do too.

Monday, March 06, 2006
Here's an implementation in JS:

In that example, links is an array of arrays like [["computer", 1552],["posse", 1410]]. If you're linking to external URLs rather than internal object IDs, you'll need to modify the "link" function appropriately.

This algorithm is O(n^2) - I believe an O(n ln*n) algorithm can be done with use of a trie, but I don't have an implementation handy.
R. C. James Harlow Send private email
Monday, March 06, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz