r77349 - in /trunk/liblingua-es-numeros-perl: Changes META.yml debian/changelog debian/compat debian/control debian/copyright debian/source/ debian/source/format lib/Lingua/ES/Numeros.pm t/t01_init.t t/t02_cardinals.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Mon Jul 11 10:28:30 UTC 2011
Author: angelabad-guest
Date: Mon Jul 11 10:28:29 2011
New Revision: 77349
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=77349
Log:
* New upstream release
* debian/copyright: Update license stanzas
* Bump to debhelper compat 8
* Bump Standards-Version to 3.9.2 (no changes)
* Switch to dpkg-source format 3.0 (quilt)
Added:
trunk/liblingua-es-numeros-perl/debian/source/
trunk/liblingua-es-numeros-perl/debian/source/format
Modified:
trunk/liblingua-es-numeros-perl/Changes
trunk/liblingua-es-numeros-perl/META.yml
trunk/liblingua-es-numeros-perl/debian/changelog
trunk/liblingua-es-numeros-perl/debian/compat
trunk/liblingua-es-numeros-perl/debian/control
trunk/liblingua-es-numeros-perl/debian/copyright
trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm
trunk/liblingua-es-numeros-perl/t/t01_init.t
trunk/liblingua-es-numeros-perl/t/t02_cardinals.t
Modified: trunk/liblingua-es-numeros-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/Changes?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/Changes (original)
+++ trunk/liblingua-es-numeros-perl/Changes Mon Jul 11 10:28:29 2011
@@ -1,4 +1,11 @@
Revision history for Perl extension Lingua::ES::Numeros.
+
+0.09 dom jul 10 13:25:46 VET 2011
+ - Fix HTML entities names when MAYUSCULAS=>1 as reported via RT #69323
+ by Eduardo Tubert <eatubert at insoft.com.mx>
+ - New test cases for HTML entity names
+ - Split cardinal method to use cardinal_str. Fixes a bug found after
+ fixing entity names.
0.08 Wed Mar 3 11:43:08 VET 2010
- Create tag :constants to import genre constants
Modified: trunk/liblingua-es-numeros-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/META.yml?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/META.yml (original)
+++ trunk/liblingua-es-numeros-perl/META.yml Mon Jul 11 10:28:29 2011
@@ -1,14 +1,22 @@
--- #YAML:1.0
-name: Lingua-ES-Numeros
-version: 0.08
-abstract: Translates numbers to spanish text
-license: ~
-author:
+name: Lingua-ES-Numeros
+version: 0.09
+abstract: Translates numbers to spanish text
+author:
- Jose Rey <jrey at cpan.org>
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
- Carp: 0
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Carp: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: trunk/liblingua-es-numeros-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/changelog?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/changelog (original)
+++ trunk/liblingua-es-numeros-perl/debian/changelog Mon Jul 11 10:28:29 2011
@@ -1,3 +1,13 @@
+liblingua-es-numeros-perl (0.09-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/copyright: Update license stanzas
+ * Bump to debhelper compat 8
+ * Bump Standards-Version to 3.9.2 (no changes)
+ * Switch to dpkg-source format 3.0 (quilt)
+
+ -- Angel Abad <angelabad at gmail.com> Mon, 11 Jul 2011 12:28:16 +0200
+
liblingua-es-numeros-perl (0.08-1) unstable; urgency=low
* New upstream release
Modified: trunk/liblingua-es-numeros-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/compat?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/compat (original)
+++ trunk/liblingua-es-numeros-perl/debian/compat Mon Jul 11 10:28:29 2011
@@ -1,1 +1,1 @@
-7
+8
Modified: trunk/liblingua-es-numeros-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/control?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/control (original)
+++ trunk/liblingua-es-numeros-perl/debian/control Mon Jul 11 10:28:29 2011
@@ -1,16 +1,17 @@
Source: liblingua-es-numeros-perl
Section: perl
Priority: optional
-Build-Depends: debhelper (>= 7)
+Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
+Uploaders:
+ gregor herrmann <gregoa at debian.org>,
+ Damyan Ivanov <dmn at debian.org>,
+ Angel Abad <angelabad at gmail.com>
+Build-Depends: debhelper (>= 8)
Build-Depends-Indep: perl
-Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders:
- gregor herrmann <gregoa at debian.org>,
- Damyan Ivanov <dmn at debian.org>, Angel Abad <angelabad at gmail.com>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.2
+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/liblingua-es-numeros-perl/
+Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liblingua-es-numeros-perl/
Homepage: http://search.cpan.org/dist/Lingua-ES-Numeros/
-Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liblingua-es-numeros-perl/
-Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/liblingua-es-numeros-perl/
Package: liblingua-es-numeros-perl
Architecture: all
Modified: trunk/liblingua-es-numeros-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/copyright?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/copyright (original)
+++ trunk/liblingua-es-numeros-perl/debian/copyright Mon Jul 11 10:28:29 2011
@@ -12,15 +12,15 @@
2006, Gunnar Wolf <gwolf at debian.org>
2007, Damyan Ivanov <dmn at debian.org>
2008, gregor herrmann <gregoa at debian.org>
- 2009-2010, Angel Abad <angelabad at gmail.com>
+ 2009-2011, Angel Abad <angelabad at gmail.com>
License: Artistic or GPL-1+
License: Artistic
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, which comes with Perl.
.
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
This program is free software; you can redistribute it and/or modify
@@ -28,5 +28,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian GNU/Linux systems, the complete text of the GNU General
- Public License can be found in `/usr/share/common-licenses/GPL'
+ On Debian systems, the complete text of version 1 of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.
Added: trunk/liblingua-es-numeros-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/source/format?rev=77349&op=file
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/source/format (added)
+++ trunk/liblingua-es-numeros-perl/debian/source/format Mon Jul 11 10:28:29 2011
@@ -1,0 +1,1 @@
+3.0 (quilt)
Modified: trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm (original)
+++ trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm Mon Jul 11 10:28:29 2011
@@ -39,7 +39,7 @@
use base qw( Exporter );
-our $VERSION = '0.08';
+our $VERSION = '0.09';
our @EXPORT = qw( );
our @EXPORT_OK = qw( MALE FEMALE NEUTRAL MASCULINO FEMENINO NEUTRO );
@@ -253,7 +253,7 @@
=cut
-sub cardinal($) {
+sub cardinal_str($) {
my $self = shift;
my $num = shift;
my ( $sgn, $ent, $frc, $exp ) = parse_num( $num, $self->{'DECIMAL'}, $self->{'SEPARADORES'} );
@@ -261,11 +261,16 @@
if (@words) {
unshift @words, $self->{'NEGATIVO'} if $sgn < 0 and $self->{'NEGATIVO'};
unshift @words, $self->{'POSITIVO'} if $sgn > 0 and $self->{'POSITIVO'};
- $self->retval( join( " ", @words ) );
+ return join( " ", @words );
}
else {
- $self->retval('cero');
- }
+ 'cero';
+ }
+}
+
+sub cardinal($) {
+ my $self = shift;
+ $self->retval($self->cardinal_str(shift));
}
=head2 real
@@ -347,7 +352,7 @@
};
}
if ($ent) {
- $ent = $self->cardinal( ( $sgn < 0 ? '-' : '+' ) . $ent );
+ $ent = $self->cardinal_str( ( $sgn < 0 ? '-' : '+' ) . $ent );
}
else {
$ent = 'cero';
@@ -1293,19 +1298,18 @@
sub retval($$) {
my $self = shift;
my $rv = shift;
+ $rv = uc $rv if $self->{MAYUSCULAS};
if ( $self->{ACENTOS} ) {
if ( $self->{HTML} ) {
- $rv =~ s/([áéÃóú])/&$1acute;/g;
- $rv =~ tr/áéÃóú/aeiou/;
+ $rv =~ s/([ÃáÃéÃÃÃóÃú])/&$1acute;/g;
+ $rv =~ tr/ÃáÃéÃÃÃóÃú/AaEeIiOoUu/;
}
}
else {
- $rv =~ tr/áéÃóú/aeiou/;
- }
- return $self->{MAYUSCULAS} ? uc $rv : $rv;
-}
-
-# Preloaded methods go here.
+ $rv =~ tr/ÃáÃéÃÃÃóÃú/AaEeIiOoUu/;
+ }
+ return $rv;
+}
1;
__END__
Modified: trunk/liblingua-es-numeros-perl/t/t01_init.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/t/t01_init.t?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/t/t01_init.t (original)
+++ trunk/liblingua-es-numeros-perl/t/t01_init.t Mon Jul 11 10:28:29 2011
@@ -9,7 +9,7 @@
use strict;
use warnings;
-use Test::More tests => 81;
+use Test::More tests => 85;
BEGIN { use_ok('Lingua::ES::Numeros') }
#########################
@@ -124,5 +124,23 @@
}
}
+sub simple_tests {
+ my $obj = Lingua::ES::Numeros->new();
+
+ # Check for proper XHTML entity names, testscase for bug #69323
+ # thanks to "Eduardo Tubert" <eatubert at insoft.com.mx>
+ $obj->acentos(1);
+ ok($obj->cardinal(16016) eq "dieciséis mil dieciséis", "Lowercase text with accents");
+ $obj->mayusculas( 1 );
+ ok($obj->cardinal(16016) eq "DIECISÃIS MIL DIECISÃIS", "Uppercase text with accents");
+ $obj->mayusculas( 0 );
+ $obj->html(1);
+ ok($obj->cardinal(16016) eq "dieciséis mil dieciséis", "Lowercase XHTML");
+ $obj->mayusculas( 1 );
+ ok($obj->cardinal(16016) eq "DIECISÉIS MIL DIECISÉIS", "Uppercase XHTML");
+ $obj->mayusculas( 0 );
+}
+
accesors;
parser;
+simple_tests;
Modified: trunk/liblingua-es-numeros-perl/t/t02_cardinals.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/t/t02_cardinals.t?rev=77349&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/t/t02_cardinals.t (original)
+++ trunk/liblingua-es-numeros-perl/t/t02_cardinals.t Mon Jul 11 10:28:29 2011
@@ -77,6 +77,12 @@
}
}
+sub xml_uc($) {
+ my $t = uc shift;
+ $t =~ s/ACUTE;/acute;/g;
+ return $t;
+}
+
sub cardinal_test_real {
my $self = shift;
@@ -90,7 +96,7 @@
$obj->{'HTML'} = 1;
$obj->{'DECIMAL'} = ",";
$t = $obj->real("122,345");
- is( $t, uc "ciento veintidós CON trescientas cuarenta y cinco milésimas",
+ is( $t, xml_uc "ciento veintidós CON trescientas cuarenta y cinco milésimas",
"t_real_2" );
$obj->{'MAYUSCULAS'} = 0;
$t = $obj->real("122,345");
@@ -123,11 +129,11 @@
is( $t, "ciento veinticuatro CON trescientos cuarenta y cinco milésimos", "t_real_2" );
$obj->{'MAYUSCULAS'} = 1;
$t = $obj->real("122.345");
- is( $t, uc "ciento veintidós CON trescientos cuarenta y cinco milésimos", "t_real_2" );
+ is( $t, xml_uc "ciento veintidós CON trescientos cuarenta y cinco milésimos", "t_real_2" );
$obj->{'HTML'} = 1;
$obj->{'DECIMAL'} = ",";
$t = $obj->real("122,345");
- is( $t, uc "ciento veintidós CON trescientos cuarenta y cinco milésimos",
+ is( $t, xml_uc "ciento veintidós CON trescientos cuarenta y cinco milésimos",
"t_real_2" );
$obj->{'MAYUSCULAS'} = 0;
$t = $obj->real("122,345");
More information about the Pkg-perl-cvs-commits
mailing list