Lingua::EN::Summarize::Filters - Helper functions for the Summarize module


Lingua-EN-Summarize documentation Contained in the Lingua-EN-Summarize distribution.

Index


Code Index:

NAME

Top

Lingua::EN::Summarize::Filters - Helper functions for the Summarize module

SYNOPSIS

Top

  See the Lingua::EN::Summarize documentation.

DESCRIPTION

Top

See the Lingua::EN::Summarize documentation.

AUTHOR

Top

Dennis Taylor, <dennis@funkplanet.com>

SEE ALSO

Top

Lingua::EN::Summarize (got the point yet? :-)


Lingua-EN-Summarize documentation Contained in the Lingua-EN-Summarize distribution.

package Lingua::EN::Summarize::Filters;

use strict;
use Carp;


sub easyhtml {
  my $text = shift;

  # A very simple-minded HTML stripper.
  $text =~ s/<(?:[^>\'\"]*|([\'\"]).*?\1)*>//gs;
  return $text;
}


sub html {
  my $html = shift;
  my $text = '';

  # closure!
  my $callback = sub { $text .= shift };

  require HTML::Parser;
  my $parser = HTML::Parser->new( api_version => 3,
				  text_h => [ $callback, "dtext" ] );
  $parser->parse( $html );
  $parser->eof();

  return $text;
}


sub email {
  my $text = shift;

  # magic goes here
  croak "Not implemented yet FIXME FIXME FIXME";
}



1;
__END__