admin
Karma: 98
|
Re:Click on word = check glossary - 2010/04/20 16:59
It's an interesting idea. Although I think there would be pros and cons.
If the popup is to be instant, then it will have to be something like JavaScript, with the text for the popup already in the browser. For that to happen, the check of words would have to have happened prior to sending the page.
If it is to be possible to click on any word, that implies that every word in the article would have to be a link, which would involve quite a lot of processing of the page, and involve a significant overhead of extra HTML.
Given those issues, I'm inclined to stick with the present logic, although there are improvements being developed for the next release. Two schemes are being adopted to increase the speed of processing:
1. The way the lookups in the glossary are done is being optimized so as to eliminate most terms by virtue of the page content, selecting only terms that could possibly appear on the page for more detailed scanning.
2. A degree of caching is adopted by means of hashing the whole page and assuming that if the hash has not changed, then a cached result can be used, provided it is not too old. Cached pages must expire after a while, otherwise changes in the glossary will not affect the output pages unless their source changes.
Martin Brampton aka Counterpoint http://aliro.org http://black-sheep-research.com |