summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2022-06-26 20:20:20 +0200
committergregor herrmann <gregoa@debian.org>2022-06-26 20:20:20 +0200
commit37dbac7ecd175fbf5ceb6123461739cff9a030eb (patch)
tree323ebc2e3029de5e3855116f600a0fd6f95a53eb
parent5a6df470b60ffb934236238142f655016160f85a (diff)
New upstream version 0.29
-rw-r--r--Changes5
-rw-r--r--MANIFEST4
-rw-r--r--META.json37
-rw-r--r--META.yml36
-rw-r--r--README2
-rw-r--r--lib/Lingua/Translit.pm12
-rw-r--r--lib/Lingua/Translit/Tables.pm4
-rw-r--r--t/90_zero.t87
-rwxr-xr-xtools/substitute_tables.pl2
-rwxr-xr-xtranslit8
10 files changed, 165 insertions, 32 deletions
diff --git a/Changes b/Changes
index 4db9095..ffcaa84 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,8 @@
+0.29 -- 2022-06-15
+
+ * Fixed numeric zero and empty string argument handling in translit() &
+ translit_reverse().
+
0.28 -- 2017-10-16
* Fixed wrong capitalised Cyrillic A in several context rules of both
diff --git a/MANIFEST b/MANIFEST
index 27648f0..0b96764 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -65,4 +65,6 @@ xml/tables.dump
xml/template.xml
xml/translit.dtd
xml/xml2dump.pl
-META.yml Module meta-data (added by MakeMaker)
+t/90_zero.t
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..bffef0b
--- /dev/null
+++ b/META.json
@@ -0,0 +1,37 @@
+{
+ "abstract" : "transliterates text between writing systems",
+ "author" : [
+ "Alex Linke <alinke@netzum-sorglos.de>"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : 2
+ },
+ "name" : "Lingua-Translit",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "version" : "0.29",
+ "x_serialization_backend" : "JSON::PP version 2.97001"
+}
diff --git a/META.yml b/META.yml
index e4a6adc..ebb64dd 100644
--- a/META.yml
+++ b/META.yml
@@ -1,21 +1,21 @@
---- #YAML:1.0
-name: Lingua-Translit
-version: 0.28
-abstract: transliterates text between writing systems
+---
+abstract: 'transliterates text between writing systems'
author:
- - Alex Linke <alinke@netzum-sorglos.de>
-license: perl
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
+ - 'Alex Linke <alinke@netzum-sorglos.de>'
build_requires:
- ExtUtils::MakeMaker: 0
-requires: {}
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.57_05
+ ExtUtils::MakeMaker: '0'
+configure_requires:
+ ExtUtils::MakeMaker: '0'
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
+license: perl
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+name: Lingua-Translit
+no_index:
+ directory:
+ - t
+ - inc
+version: '0.29'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/README b/README
index df037b3..1385f68 100644
--- a/README
+++ b/README
@@ -31,7 +31,7 @@ COPYRIGHT AND LICENSE
Copyright (C) 2007-2008 Alex Linke and Rona Linke
Copyright (C) 2009-2016 Lingua-Systems Software GmbH
Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-Copyright (C) 2017 Netzum Sorglos Software GmbH
+Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
diff --git a/lib/Lingua/Translit.pm b/lib/Lingua/Translit.pm
index b26f728..8dbb42d 100644
--- a/lib/Lingua/Translit.pm
+++ b/lib/Lingua/Translit.pm
@@ -6,7 +6,7 @@ package Lingua::Translit;
# Rona Linke <rlinke@lingua-systems.com>
# Copyright (C) 2009-2016 Lingua-Systems Software GmbH
# Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-# Copyright (C) 2017 Netzum Sorglos Software GmbH
+# Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
#
use strict;
@@ -19,7 +19,7 @@ use Encode qw/encode decode/;
use Lingua::Translit::Tables;
-our $VERSION = '0.28';
+our $VERSION = '0.29';
=pod
@@ -134,7 +134,8 @@ sub translit {
my $text = shift();
# Return if no input was given
- return unless $text;
+ return undef if ! defined $text;
+ return '' if $text eq '';
my $utf8_flag_on = Encode::is_utf8($text);
@@ -194,7 +195,8 @@ sub translit_reverse {
my $text = shift();
# Return if no input was given
- return unless $text;
+ return undef if ! defined $text;
+ return '' if $text eq '';
# Is this transliteration reversible?
croak("$self->{name} cannot be reversed") unless $self->{reverse};
@@ -417,7 +419,7 @@ Copyright (C) 2009-2016 Lingua-Systems Software GmbH
Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-Copyright (C) 2017 Netzum Sorglos Software GmbH
+Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
diff --git a/lib/Lingua/Translit/Tables.pm b/lib/Lingua/Translit/Tables.pm
index 026e719..c22bed7 100644
--- a/lib/Lingua/Translit/Tables.pm
+++ b/lib/Lingua/Translit/Tables.pm
@@ -6,7 +6,7 @@ package Lingua::Translit::Tables;
# Rona Linke <rlinke@lingua-systems.com>
# Copyright (C) 2009-2016 Lingua-Systems Software GmbH
# Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-# Copyright (C) 2017 Netzum Sorglos Software GmbH
+# Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
#
use strict;
@@ -312,7 +312,7 @@ Copyright (C) 2009-2016 Lingua-Systems Software GmbH
Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-Copyright (C) 2017 Netzum Sorglos Software GmbH
+Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
diff --git a/t/90_zero.t b/t/90_zero.t
new file mode 100644
index 0000000..a91a46c
--- /dev/null
+++ b/t/90_zero.t
@@ -0,0 +1,87 @@
+use strict;
+use Test::More tests => 15;
+
+my $name = "DIN 1460 UKR";
+my $reversible = 1;
+
+use Lingua::Translit;
+
+my $tr = new Lingua::Translit($name);
+
+my $output;
+
+
+# 1
+is($tr->can_reverse(), $reversible, "$name: reversibility");
+
+# 2
+$output = $tr->translit( "0" );
+
+is($output, "0", "$name: transliteration #1");
+
+# 3
+$output = $tr->translit( 0 );
+
+is($output, "0", "$name: transliteration #2");
+
+# 4
+$output = $tr->translit( "\x30" );
+
+is($output, "0", "$name: transliteration #3");
+
+# 5
+$output = $tr->translit();
+
+is($output, undef, "$name: transliteration #4");
+
+# 6
+$output = $tr->translit( undef );
+
+is($output, undef, "$name: transliteration #5");
+
+# 7
+$output = $tr->translit( '' );
+
+is($output, '', "$name: transliteration #6");
+
+# 8
+$output = $tr->translit( '01' );
+
+is($output, '01', "$name: transliteration #7");
+
+# 9
+$output = $tr->translit_reverse( "0" );
+
+is($output, "0", "$name: transliteration #8");
+
+# 10
+$output = $tr->translit_reverse( 0 );
+
+is($output, "0", "$name: transliteration #9");
+
+# 11
+$output = $tr->translit_reverse( "\x30" );
+
+is($output, "0", "$name: transliteration #10");
+
+# 12
+$output = $tr->translit_reverse();
+
+is($output, undef, "$name: transliteration #11");
+
+# 13
+$output = $tr->translit_reverse( undef );
+
+is($output, undef, "$name: transliteration #12");
+
+# 14
+$output = $tr->translit_reverse( '' );
+
+is($output, '', "$name: transliteration #13");
+
+# 15
+$output = $tr->translit_reverse( '01' );
+
+is($output, '01', "$name: transliteration #14");
+
+# vim: set ft=perl sts=4 sw=4 ts=4 ai et:
diff --git a/tools/substitute_tables.pl b/tools/substitute_tables.pl
index bf38141..13280c8 100755
--- a/tools/substitute_tables.pl
+++ b/tools/substitute_tables.pl
@@ -4,7 +4,7 @@
# Copyright (C) 2007-2008 Alex Linke <alinke@lingua-systems.com>
# Copyright (C) 2009-2016 Lingua-Systems Software GmbH
# Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-# Copyright (C) 2017 Netzum Sorglos Software GmbH
+# Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
#
use strict;
diff --git a/translit b/translit
index e4bed86..0dc927f 100755
--- a/translit
+++ b/translit
@@ -6,7 +6,7 @@
# Rona Linke <rlinke@lingua-systems.com>
# Copyright (C) 2009-2016 Lingua-Systems Software GmbH
# Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-# Copyright (C) 2017 Netzum Sorglos Software GmbH
+# Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
#
use strict;
@@ -17,7 +17,7 @@ require 5.008;
use Lingua::Translit;
use Lingua::Translit::Tables qw/:all/;
-my $VERSION = '0.5';
+my $VERSION = '0.6';
=pod
@@ -188,7 +188,7 @@ sub show_help {
my $retval = shift();
print "translit v$VERSION -- ",
- "(c) 2009-2016 Lingua-Systems Software GmbH\n\n",
+ "(c) 2007-2022 Netzum Sorglos Software GmbH\n\n",
"usage: $0 -i FILE -o FILE -t NAME -r -l -v -h\n\n",
" --infile -i FILE read input from FILE\n",
" --outfile -o FILE write output to FILE\n",
@@ -240,7 +240,7 @@ Copyright (C) 2009-2016 Lingua-Systems Software GmbH
Copyright (C) 2016-2017 Netzum Sorglos, Lingua-Systems Software GmbH
-Copyright (C) 2017 Netzum Sorglos Software GmbH
+Copyright (C) 2017-2022 Netzum Sorglos Software GmbH
This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.