Text::Context::Porter - Text::Context with inflection awareness


Text-Context-Porter documentation  | view source Contained in the Text-Context-Porter distribution.

Index


NAME

Top

Text::Context::Porter - Text::Context with inflection awareness

SYNOPSIS

Top

  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;

DESCRIPTION

Top

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-Porter documentation  | view source Contained in the Text-Context-Porter distribution.