Text::Context::Porter - Text::Context with inflection awareness
use Text::Context::Porter; my $snippet = Text::Context::Porter->new($text, @keywords); $snippet->keywords("foo", "bar"); # In case you change your mind print $snippet->as_html; print $snippet->as_text;
Given a piece of text and some search terms, produces an object which locates the search terms in the message, extracts a reasonable-length string containing all the search terms, and optionally dumps the string out as HTML text with the search terms highlighted in bold.
However, unlike the ordinary Text::Context, this subclass is able to highlight terms in the document which are inflected variants of the search terms. For instance, searching for "testing" should highlight "test", "tested" and so on.
Text::Context
Copyright (C) 2004,2006 Simon Cozens
You may use and redistribute this module under the same terms as Perl itself.
To install Text::Context::Porter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Context::Porter
CPAN shell
perl -MCPAN -e shell install Text::Context::Porter
For more information on module installation, please visit the detailed CPAN module installation guide.