r50412 - in /trunk/liblingua-es-numeros-perl: Changes META.yml debian/changelog debian/control debian/copyright lib/Lingua/ES/Numeros.pm t/t02_cardinals.t t/t04_ordinals.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Thu Jan 7 00:03:12 UTC 2010
Author: angelabad-guest
Date: Thu Jan 7 00:01:38 2010
New Revision: 50412
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50412
Log:
New upstream release 0.07
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/control
trunk/liblingua-es-numeros-perl/debian/copyright
trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm
trunk/liblingua-es-numeros-perl/t/t02_cardinals.t
trunk/liblingua-es-numeros-perl/t/t04_ordinals.t
Modified: trunk/liblingua-es-numeros-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/Changes?rev=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/Changes (original)
+++ trunk/liblingua-es-numeros-perl/Changes Thu Jan 7 00:01:38 2010
@@ -1,4 +1,8 @@
Revision history for Perl extension Lingua::ES::Numeros.
+
+0.07 Wed Jan 6 00:14:36 VET 2010
+ - Corrected fractional formating bug in real() thanks to Joaquin Ferrero
+ - Corrected female hundreths under one million
0.06 Sun Sep 6 18:58:32 VET 2009
- Correct spelling for 2 from dós to dos
Modified: trunk/liblingua-es-numeros-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/META.yml?rev=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/META.yml (original)
+++ trunk/liblingua-es-numeros-perl/META.yml Thu Jan 7 00:01:38 2010
@@ -1,11 +1,22 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Lingua-ES-Numeros
-version: 0.06
-version_from: lib/Lingua/ES/Numeros.pm
-installdirs: site
+--- #YAML:1.0
+name: Lingua-ES-Numeros
+version: 0.07
+abstract: Translates numbers to spanish text
+author:
+ - Jose Rey <jrey at cpan.org>
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
- Carp: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30_01
+ 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.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=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/changelog (original)
+++ trunk/liblingua-es-numeros-perl/debian/changelog Thu Jan 7 00:01:38 2010
@@ -1,3 +1,9 @@
+liblingua-es-numeros-perl (0.07-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Angel Abad <angelabad at gmail.com> Thu, 07 Jan 2010 00:59:39 +0100
+
liblingua-es-numeros-perl (0.06-2) UNRELEASED; urgency=low
* Update my email address
Modified: trunk/liblingua-es-numeros-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/control?rev=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/control (original)
+++ trunk/liblingua-es-numeros-perl/debian/control Thu Jan 7 00:01:38 2010
@@ -6,8 +6,7 @@
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Gunnar Wolf <gwolf at debian.org>,
gregor herrmann <gregoa at debian.org>,
- Damyan Ivanov <dmn at debian.org>,
- Angel Abad <angelabad at gmail.com>
+ Damyan Ivanov <dmn at debian.org>, Angel Abad <angelabad at gmail.com>
Standards-Version: 3.8.3
Homepage: http://search.cpan.org/dist/Lingua-ES-Numeros/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liblingua-es-numeros-perl/
Modified: trunk/liblingua-es-numeros-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/debian/copyright?rev=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/debian/copyright (original)
+++ trunk/liblingua-es-numeros-perl/debian/copyright Thu Jan 7 00:01:38 2010
@@ -1,32 +1,33 @@
-Format-Specification:
- http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Jose Rey <jrey at cpan.org>
-Upstream-Source: http://search.cpan.org/dist/Lingua-ES-Numeros/
-Upstream-Name: Lingua-ES-Numeros
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Jose Rey <jrey at cpan.org>
+Source: http://search.cpan.org/dist/Lingua-ES-Numeros/
+Name: Lingua-ES-Numeros
Files: *
-Copyright: 2001-2009, Jose Rey <jrey at cpan.org>
-License: Artistic | GPL-1+
+Copyright: 2001-2010, Jose Rey <jrey at cpan.org>
+License: Artistic or GPL-1+
Files: debian/*
Copyright: 2006, David Moreno Garza <damog at debian.org>
2006, Gunnar Wolf <gwolf at debian.org>
2007, Damyan Ivanov <dmn at debian.org>
- 2008, gregor herrmann <gregoa at debian.org>
2008, gregor herrmann <gregor+debian at comodo.priv.at>
+ 2009, 2010, Angel Abad <angelabad at gmail.com>
2009, Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>
-License: Artistic | GPL-1+
+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'
+ 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'
License: GPL-1+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- 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'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ 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'
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=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm (original)
+++ trunk/liblingua-es-numeros-perl/lib/Lingua/ES/Numeros.pm Thu Jan 7 00:01:38 2010
@@ -39,7 +39,7 @@
our @ISA = qw();
-our $VERSION = '0.06';
+our $VERSION = '0.07';
our @EXPORT = qw( MALE FEMALE NEUTRAL );
@@ -328,7 +328,7 @@
/%([0-9]*)d/ && do {
# Numérico, se da formato a los dÃgitos
- $frc = substr( '0' x $exp . $frc, 0, $1 );
+ $frc = substr( '0' x $exp . $frc . '0' x $1, 0, $1 );
$frc = sprintf( $self->{'FORMATO'}, $frc );
last;
};
@@ -688,6 +688,14 @@
$n .= "0" x ( $exp % 6 ); # agregar ceros a la derecha
my $mag = int( $exp / 6 );
my @group = ();
+
+ # Translate the lower 6 digits for female numbers
+ if ($gen eq FEMALE) {
+ $n =~ s/(.{1,6})$//x;
+ $fmag->( $1, \@group, $mag++ );
+ s/cientos$/cientas/g for @group;
+ }
+
$fmag->( $1, \@group, $mag++ ) while $n =~ s/(.{1,6})$//x;
$group[0] .= $gen if $group[0] =~ /un$/;
reverse @group;
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=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/t/t02_cardinals.t (original)
+++ trunk/liblingua-es-numeros-perl/t/t02_cardinals.t Thu Jan 7 00:01:38 2010
@@ -8,7 +8,7 @@
use utf8;
#use lib '/home/opr/W/Projects/Numeros/Lingua-ES-Numbers/lib/';
-use Test::More tests => 32168;
+use Test::More tests => 21835;
BEGIN { use_ok('Lingua::ES::Numeros') }
#########################
@@ -58,15 +58,22 @@
my $self = shift;
my $obj = Lingua::ES::Numeros->new( GENERO => 'a' );
+ for my $i ( 0 .. 99 ) {
+ my $n = sprintf("%02d", $i);
+ $t = $obj->real("11.$n");
+ is( $t, "once con $n ctms.", "t_real_2" );
+ }
while ( my ( $k, $v ) = each %$self ) {
next if $k =~ /^z/;
my $t = $obj->cardinal($k);
$v =~ s/un$/una/g;
+ if ( $v =~ s/(.*(?:illones|llón))?(.+)// ) {
+ my ($hi, $lo) = ($1 || '', $2);
+ $lo =~ s/cientos/cientas/g;
+ $v = $hi . $lo;
+ }
$v = 'cero' if $v eq '';
is( $t, $v, "t_cardinal_2" );
-
- $t = $obj->real("$k.16");
- is( $t, "$v con 16 ctms.", "t_real_2" );
}
}
@@ -76,18 +83,18 @@
my $obj = Lingua::ES::Numeros->new( SEXO => 'a' );
$obj->{'FORMATO'} = "CON %s";
my $t = $obj->real("124.345");
- is( $t, "ciento veinticuatro CON trescientos cuarenta y cinco milésimas", "t_real_2" );
+ is( $t, "ciento veinticuatro CON trescientas cuarenta y cinco milésimas", "t_real_2" );
$obj->{'MAYUSCULAS'} = 1;
$t = $obj->real("122.345");
- is( $t, uc "ciento veintidós CON trescientos cuarenta y cinco milésimas", "t_real_2" );
+ is( $t, uc "ciento veintidós CON trescientas cuarenta y cinco milésimas", "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ésimas",
+ is( $t, uc "ciento veintidós CON trescientas cuarenta y cinco milésimas",
"t_real_2" );
$obj->{'MAYUSCULAS'} = 0;
$t = $obj->real("122,345");
- is( $t, "ciento veintidós CON trescientos cuarenta y cinco milésimas",
+ is( $t, "ciento veintidós CON trescientas cuarenta y cinco milésimas",
"t_real_2" );
eval { $t = $obj->real("122.345") };
ok( $@ =~ /^Error de sintaxis/, "Real error de sintaxis" );
@@ -97,13 +104,54 @@
$obj->{'ACENTOS'} = 0;
$obj->{'POSITIVO'} = "positivo";
$t = $obj->real("124.345");
- is( $t, uc "positivo ciento veinticuatro CON trescientos cuarenta y cinco milesimas",
+ is( $t, uc "positivo ciento veinticuatro CON trescientas cuarenta y cinco milesimas",
"t_real_2" );
$obj->{'MAYUSCULAS'} = 0;
$t = $obj->real("-0.124345e3");
- is( $t, "menos ciento veinticuatro CON trescientos cuarenta y cinco milesimas", "t_real_2" );
- $t = $obj->real("-124345e-3");
- is( $t, "menos ciento veinticuatro CON trescientos cuarenta y cinco milesimas", "t_real_2" );
+ is( $t, "menos ciento veinticuatro CON trescientas cuarenta y cinco milesimas", "t_real_2" );
+ $t = $obj->real("-124345e-3");
+ is( $t, "menos ciento veinticuatro CON trescientas cuarenta y cinco milesimas", "t_real_2" );
+ $t = $obj->real("-0.224345e3");
+ is( $t, "menos doscientas veinticuatro CON trescientas cuarenta y cinco milesimas", "t_real_2" );
+ $t = $obj->real("-224345e-3");
+ is( $t, "menos doscientas veinticuatro CON trescientas cuarenta y cinco milesimas", "t_real_2" );
+
+
+ $obj = Lingua::ES::Numeros->new( GENERO => 'o' );
+ $obj->{'FORMATO'} = "CON %s";
+ $t = $obj->real("124.345");
+ 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" );
+ $obj->{'HTML'} = 1;
+ $obj->{'DECIMAL'} = ",";
+ $t = $obj->real("122,345");
+ is( $t, uc "ciento veintidós CON trescientos cuarenta y cinco milésimos",
+ "t_real_2" );
+ $obj->{'MAYUSCULAS'} = 0;
+ $t = $obj->real("122,345");
+ is( $t, "ciento veintidós CON trescientos cuarenta y cinco milésimos",
+ "t_real_2" );
+ eval { $t = $obj->real("122.345") };
+ ok( $@ =~ /^Error de sintaxis/, "Real error de sintaxis" );
+ $obj->{'DECIMAL'} = ".";
+ $obj->{'HTML'} = 0;
+ $obj->{'MAYUSCULAS'} = 1;
+ $obj->{'ACENTOS'} = 0;
+ $obj->{'POSITIVO'} = "positivo";
+ $t = $obj->real("124.345");
+ is( $t, uc "positivo ciento veinticuatro CON trescientos cuarenta y cinco milesimos",
+ "t_real_2" );
+ $obj->{'MAYUSCULAS'} = 0;
+ $t = $obj->real("-0.124345e3");
+ is( $t, "menos ciento veinticuatro CON trescientos cuarenta y cinco milesimos", "t_real_2" );
+ $t = $obj->real("-124345e-3");
+ is( $t, "menos ciento veinticuatro CON trescientos cuarenta y cinco milesimos", "t_real_2" );
+ $t = $obj->real("-0.224345e3");
+ is( $t, "menos doscientos veinticuatro CON trescientos cuarenta y cinco milesimos", "t_real_2" );
+ $t = $obj->real("-224345e-3");
+ is( $t, "menos doscientos veinticuatro CON trescientos cuarenta y cinco milesimos", "t_real_2" );
$obj = $obj->new( GENERO => 'o' );
$obj->{'FORMATO'} = "CON %2d";
Modified: trunk/liblingua-es-numeros-perl/t/t04_ordinals.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liblingua-es-numeros-perl/t/t04_ordinals.t?rev=50412&op=diff
==============================================================================
--- trunk/liblingua-es-numeros-perl/t/t04_ordinals.t (original)
+++ trunk/liblingua-es-numeros-perl/t/t04_ordinals.t Thu Jan 7 00:01:38 2010
@@ -69,13 +69,13 @@
}
eval { $obj->ordinal( 1 x 126 ) };
- ok( !$@, "Ordinal en rango" );
+ ok( !$@, "Ordinal in range" );
eval { $obj->ordinal( 1 x 127 ) };
- ok( $@ =~ /^Fuera de rango/, "Ordinal fuera de rango" );
+ ok( $@ =~ /^Fuera de rango/, "Ordinal out of range" );
eval { $obj->ordinal(-1) };
- ok( $@ =~ /^Ordinal negativo/, "Ordinal negativo" );
+ ok( $@ =~ /^Ordinal negativo/, "Negative ordinal" );
# FIXME: some way to check carp ?
eval { $obj->ordinal(-0) };
More information about the Pkg-perl-cvs-commits
mailing list