in reply to Retreaving N first sentences from text.
Lingua::EN::Sentence has lots of re's:
use Lingua::EN::Sentence qw( get_sentences ); sub nsentences { my ($num, @text) = @_; my $sentences = get_sentences(join " ",@text); join " ", @{$sentences}[0..$num-1]; }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Retreaving N first sentences from text.
by c0d34w4y (Acolyte) on Dec 15, 2001 at 04:20 UTC |