Skip Menu |
 

This queue is for tickets about the Text-Autoformat CPAN distribution.

Report information
The Basics
Id: 26510
Status: open
Priority: 0/
Queue: Text-Autoformat

People
Owner: Nobody in particular
Requestors: ask [...] develooper.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.13
Fixed in: (no value)



Subject: case => "sentence" capitalizes paragraphs rather than sentences
Download (untitled) / with headers
text/plain 1.1k
case => "sentence" capitalizes paragraphs rather than sentences Test script included below and attached. - ask #!/usr/bin/perl use strict; use warnings; use Text::Autoformat; use Test::More qw(no_plan); my $input = "LOREM IPSUM DOLOR SIT AMET, CONSECTETUER ADIPISCING ELIT. ETIAM INTERDUM ULTRICES MAGNA. FUSCE EU DIAM."; my $expected = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam interdum ultrices magna. Fusce eu diam."; my $output = autoformat $input, { case => 'sentences', all => 1, right => length($input), }; is($output, $expected, "correct capitalization"); $ /pkg/bin/prove -v /tmp/af_sent.pl /tmp/af_sent....not ok 1 - correct capitalization # Failed test 'correct capitalization' # at /tmp/af_sent.pl line 20. # got: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. etiam interdum ultrices magna. # # Fusce eu diam. # ' # expected: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam interdum ultrices magna. # # Fusce eu diam.' 1..1 # Looks like you failed 1 test of 1.
Subject: af_sent.pl
Download af_sent.pl
text/x-perl 587b
#!/usr/bin/perl use strict; use warnings; use Text::Autoformat; use Test::More qw(no_plan); my $input = "LOREM IPSUM DOLOR SIT AMET, CONSECTETUER ADIPISCING ELIT. ETIAM INTERDUM ULTRICES MAGNA. FUSCE EU DIAM."; my $expected = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam interdum ultrices magna. Fusce eu diam."; my $output = autoformat $input, { case => 'sentences', all => 1, right => length($input), }; is($output, $expected, "correct capitalization");
Subject: Re: [rt.cpan.org #26510] case => "sentence" capitalizes paragraphs rather than sentences
Date: Fri, 20 Apr 2007 13:42:06 +1000
To: bug-Text-Autoformat [...] rt.cpan.org
From: "Damian Conway" <damian [...] conway.org>
Download (untitled) / with headers
text/plain 639b
Hi Ask, Show quoted text
> case => "sentence" capitalizes paragraphs rather than sentences
Actually that's not what's happening. In detecting the end of a sentence, Autoformat ignores what it thinks are full-stops marking abbreviations. And it treats any ALLCAPS as an abbreviation. The fix, if ALLCAPS are expected, is to lowercase first: my $output = autoformat lc($input), { case => 'sentences', all => 1, right => length($input), }; Damian PS: Thanks so much for including a proper test case. If only more bug reports were so considerately filed.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.