This is for Perl SWISH::API users.
I have released a SWISH::HiLiter module intended for use with
SWISH::API. It uses the HTML::HiLiter module to snip query terms in
context from swishdescription (or whatever text you want) and highlights
them in an array of colors, one color per query word.
http://search.cpan.org/~karman/
This is *NOT* intended as a drop-in replacement for the
SWISH::*Highlight module set that comes with SWISH-E.
However, I have supplied a patch to use against the search.cgi example
script that comes with SWISH-E, as an example of how to replace the use
of SWISH::PhraseHighlight and SWISH::ParseQuery with SWISH::HiLiter. My
preliminary benchmarks show that it runs about 10-20% faster on average
than SWISH::PhraseHighlight.
SWISH::HiLiter is a simple interface between SWISH::API and the
HTML::HiLiter module. It is intended to be used for snipping and
highlighting search results, *not* entire pages of HTML.
HTML::HiLiter, on the other hand, can be used for highlighting entire
pages of HTML. It uses the HTML::Parser module and is fairly quick. If
you have used HTML::HiLiter before, a new version is posted (0.11) that
supports SWISH::HiLiter.
The two modules are intended to be used together: SWISH::HiLiter for
plain text in search results; HTML::HiLiter for the original HTML document.
Comments/feedback always welcome.
--
Peter Karman . http://www.cray.com/craydoc/ . karman(at)not-real.cray.com
Received on Fri Nov 5 17:57:49 2004