in reply to Re: Split a paragraph based on the number of letters
in thread Split a paragraph based on the number of letters
I agree that the OP is not very clear. However, if the intention is actually to split a paragraph into sentences, I would strongly recommend using a module rather than trying to roll one's own parser.
Here's an example using Lingua::EN::Sentence:
use Lingua::EN::Sentence qw( get_sentences ); my $text = 'Is Mr. Hyde in? A. J. Smith Ph.D. said "Drop dead!"'; my $sentences = get_sentences($text); say for @$sentences;
Output:
Is Mr. Hyde in? A. J. Smith Ph.D. said "Drop dead!"
Update: Minor wording changes; added output.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Split a paragraph based on the number of letters
by kennethk (Abbot) on Feb 04, 2014 at 19:15 UTC |
In Section
Seekers of Perl Wisdom