Преглед на файлове

Don't delete from word_upcase hash if in charts

Will Storey преди 10 години
родител
ревизия
22ccdc4216
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      modules/Pisg/Parser/Logfile.pm

+ 5 - 1
modules/Pisg/Parser/Logfile.pm

@@ -746,7 +746,11 @@ sub _uniquify_nicks {
                 $stats->{word_upcase}{$realnick} ||= $stats->{word_upcase}{$word};
                 $stats->{word_upcase}{$realnick} ||= $stats->{word_upcase}{$word};
                 delete $stats->{wordcounts}{$word};
                 delete $stats->{wordcounts}{$word};
                 delete $stats->{wordnicks}{$word};
                 delete $stats->{wordnicks}{$word};
-                delete $stats->{word_upcase}{$word};
+                # We need the word case translation around if it is used as a
+                # song name.
+                if (!defined $stats->{chartcounts}{$word}) {
+                  delete $stats->{word_upcase}{$word};
+                }
             }
             }
         }
         }
     }
     }