|
NAMEHTML::Highlight - A module to highlight words or patterns in HTML documents SYNOPSIS use HTML::Highlight;
# create the highlighter object
my $hl = new HTML::Highlight (
words => [
'word',
'any',
'car',
'some phrase'
],
wildcards => [
undef,
'%',
'*',
undef
],
colors => [
'#FF0000',
'red',
'green',
'rgb(255, 0, 0)'
],
czech_language => 0,
debug => 0
);
# Remember that you don't need to specify your own colors.
# The default colors should be optimal.
# Now you can use the object to highlight patterns in a document
# by passing content of the document to its highlight() method.
# The highlighter object "remembers" its configuration.
my $highlighted_document = $hl->highlight($document);
MOTIVATIONThis module was originaly created to work together with fulltext indexing module DBIx::TextIndex to highlight search results. A need for a highlighter that takes wildcard matches and HTML tags into account and supports czech language (or other Slavic languages) was the motivation to create this module. DESCRIPTIONThis module provides Google-like highlighting of words or patterns in HTML documents. This feature is typically used to highlight search results.
SUPPORTNo official support is provided, but I welcome any comments, patches and suggestions on my email. BUGSI am aware of no bugs. AVAILABILITYhttp://geocities.com/tripiecz/ AUTHORTomas Styblo, tripie@cpan.org, CPAN-ID TRIPIE Prague, the Czech republic LICENSEHTML::Highlight - A module to highlight words or patterns in HTML documents Copyright (C) 2000 Tomas Styblo (tripie@cpan.org) This module is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this module. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this module, in the file Artistic. If not, I'll be glad to provide one. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA SEE ALSOperl(1). POD ERRORSHey! The above document had some coding errors, which are explained below:
|