From 34736214bf082678a5c874792046f9d3674ece8e Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 3 May 2024 07:13:12 +0300 Subject: [PATCH] #107 fix --- bibcop.pl | 1 + perl-tests/fixing.pl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bibcop.pl b/bibcop.pl index bff7fe6..e1a015f 100755 --- a/bibcop.pl +++ b/bibcop.pl @@ -619,6 +619,7 @@ sub fix_author { $author = $words[$total - 1] . ', ' . join(' ', @words[0 .. $total - 2]); } } + $author =~ s/([A-Z])\.(?![ ,])/$1. /g; $author =~ s/^\s+|\s+$//g; } return join(' and ', @authors); diff --git a/perl-tests/fixing.pl b/perl-tests/fixing.pl index 042c4d7..933eb69 100755 --- a/perl-tests/fixing.pl +++ b/perl-tests/fixing.pl @@ -37,6 +37,8 @@ package bibcop; fixes('author', 'Peter J. Landin', 'Landin, Peter J.'); fixes('author', 'Tan Yiyu and Lo {Wan Yiu}', 'Yiyu, Tan and Lo {Wan Yiu}'); fixes('author', 'van Buren, Andre', 'van Buren, Andre'); +fixes('author', 'Munsen, C.J.', 'Munsen, C. J.'); +fixes('author', 'J.J.G., Hanson', 'J. J. G., Hanson'); fixes('title', 'The TeX Book', 'The TeX Book'); fixes('title', 'Executing A program On The MIT architecture', 'Executing a Program on the MIT Architecture');