Subject: | Sentences with more than one trailing whitespace not split |
my $en = Lingua::Sentence->new("en");
for ('Hey! Now.', 'Hey... Now.', 'Hey. Now.', 'Hey. Now.') {
say "=> $_" for $en->split_array($_);
}
[sshaw@localhost trunk]$ perl ~/perl/bs.pl
=> Hey!
=> Now.
=> Hey...
=> Now.
=> Hey.
=> Now.
=> Hey. Now.
As you can see, this only applies to sentences that end with a single
period. Otherwise, these rules remove any extra trailing space https://
metacpan.org/source/ACHIMRU/Lingua-Sentence-1.03/lib/Lingua/
Sentence.pm#L106
The fix appears to be trivial; just split on /\s+/ here: https://
metacpan.org/source/ACHIMRU/Lingua-Sentence-1.03/lib/Lingua/
Sentence.pm#L120
-Skye