From e61a336c217c873f807e631ce851f0e558b3f8f1 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 15 Mar 2024 16:26:31 +0300 Subject: [PATCH] #78 fixed --- bibcop.pl | 3 +++ perl-tests/fixing.pl | 1 + 2 files changed, 4 insertions(+) diff --git a/bibcop.pl b/bibcop.pl index 950c382..05af914 100755 --- a/bibcop.pl +++ b/bibcop.pl @@ -579,6 +579,9 @@ sub fix_author { my @authors = split(/\s+and\s+/, $value); foreach my $author (@authors) { $author =~ s/^\s+|\s+$//g; + if (index($author, '{') != -1 or index($author, '}') != -1) { + next; + } $author =~ s/ ([A-Z])($| )/ $1.$2/g; if (index($author, ',') eq -1) { my @words = split(/\s+/, $author); diff --git a/perl-tests/fixing.pl b/perl-tests/fixing.pl index 413c905..dfde296 100755 --- a/perl-tests/fixing.pl +++ b/perl-tests/fixing.pl @@ -35,6 +35,7 @@ package bibcop; fixes('author', 'Brandon, Lucia', 'Brandon, Lucia'); fixes('author', 'Lucia Brandon', 'Brandon, Lucia'); fixes('author', 'Peter J. Landin', 'Landin, Peter J.'); +fixes('author', 'Tan Yiyu and Lo {Wan Yiu}', 'Yiyu, Tan and Lo {Wan Yiu}'); fixes('title', 'The TeX Book', 'The TeX Book'); fixes('title', 'Executing A program On The MIT architecture', 'Executing a Program on the MIT Architecture');