From 82bf451242c48ddf23973624f3a476661c9e81f7 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Fri, 15 Mar 2024 14:56:57 +0300 Subject: [PATCH] #77 fixed --- bibcop.pl | 8 +++----- perl-tests/fixing.pl | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bibcop.pl b/bibcop.pl index 79f815b..950c382 100755 --- a/bibcop.pl +++ b/bibcop.pl @@ -607,11 +607,9 @@ sub fix_capitalization { if (not $word =~ /^[A-Za-z]/) { next; } - if (exists $minors{$word}) { - next; - } - if (exists $minors{lc($word)} and $pos gt 1) { - $word = lc($word); + my $lc = lc($word); + if (exists $minors{$lc} and $pos gt 1 and not $words[$pos - 2] =~ /:$/) { + $word = $lc; next; } if ($word =~ /^[a-z].*/) { diff --git a/perl-tests/fixing.pl b/perl-tests/fixing.pl index 3609f69..413c905 100755 --- a/perl-tests/fixing.pl +++ b/perl-tests/fixing.pl @@ -39,6 +39,8 @@ package bibcop; fixes('title', 'The TeX Book', 'The TeX Book'); fixes('title', 'Executing A program On The MIT architecture', 'Executing a Program on the MIT Architecture'); fixes('title', 'Executing a program on the MIT Tagged-token Dataflow architecture', 'Executing a Program on the MIT Tagged-Token Dataflow Architecture'); +fixes('title', 'TeX: a Great Tool', 'TeX: A Great Tool'); +fixes('title', 'TeX: A Great Tool', 'TeX: A Great Tool'); fixes('booktitle', 'Proceedings Of IEEE Symposium On Art', 'Proceedings of Symposium on Art'); fixes('booktitle', 'Symposium on Computers', 'Proceedings of the Symposium on Computers');