Skip Menu |

This queue is for tickets about the Lingua-Sentence CPAN distribution.

Report information
The Basics
Id: 82069
Status: resolved
Priority: 0/
Queue: Lingua-Sentence

People
Owner: Nobody in particular
Requestors: SHAW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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
This is resolved in v1.04. Thanks for reporting!
On Sat Feb 02 16:12:35 2013, ACHIMRU wrote: Show quoted text
> This is resolved in v1.04. Thanks for reporting!
BTW - splitting on /\s+/ did split on already inserted newlines from earlier special case newline insertions. This caused a regression, e.g. not splitting the string "Hey! Now.". Therefore I had to split on / +/.
Re-resolved.