From 1e5913782074f4170e500f03eb664cc4b6f1934b Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 15 Mar 2024 12:30:19 +0300 Subject: [PATCH] #74 IEEE simplified --- bibcop.pl | 5 ++++- perl-tests/fixing.pl | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bibcop.pl b/bibcop.pl index 4bb4ffe..88122af 100755 --- a/bibcop.pl +++ b/bibcop.pl @@ -675,7 +675,10 @@ sub fix_journal { sub fix_publisher { my ($value) = @_; $value = fix_capitalization($value); - $value =~ s/^ACM($|[^A-Z0-9a-z].*$)/ACM/g; + my @orgs = qw/ACM IEEE/; + foreach my $org (@orgs) { + $value =~ s/^\Q$org\E($|[^A-Z0-9a-z].*$)/$org/g; + } return $value; } diff --git a/perl-tests/fixing.pl b/perl-tests/fixing.pl index 99022f7..4e21fbd 100755 --- a/perl-tests/fixing.pl +++ b/perl-tests/fixing.pl @@ -46,6 +46,9 @@ package bibcop; fixes('publisher', 'ACM New York, NY, USA', 'ACM'); fixes('publisher', 'ACME', 'ACME'); +fixes('publisher', 'IEEE Computer Society', 'IEEE'); +fixes('publisher', 'IEEE-Society', 'IEEE'); +fixes('publisher', 'IEEEth', 'IEEEth'); fixes('pages', '13', '13'); fixes('pages', '13-', '13');