in reply to Retreaving N first sentences from text.
sub get_nsentences { my ($source_text, $n) = @_; my @sentences = split /\.\s*/, $source_text; $ret_text = (join '.', @sentences[0..$n-1]) . '.'; return $ret_text; }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Retrieving N first sentences from text.
by boo_radley (Parson) on Dec 15, 2001 at 03:55 UTC | |
|
Re: Re: Retreaving N first sentences from text.
by blakem (Monsignor) on Dec 15, 2001 at 03:59 UTC |