Просмотр исходного кода

Only put wordlength restrictions on 'most used words'

Morten Brix Pedersen 25 лет назад
Родитель
Сommit
b1da1a1f10
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      modules/Pisg/HTMLGenerator.pm
  2. 1 1
      modules/Pisg/Parser/Logfile.pm

+ 1 - 0
modules/Pisg/HTMLGenerator.pm

@@ -1345,6 +1345,7 @@ sub _mostusedword
     foreach my $word (keys %{ $self->{stats}->{wordcounts} }) {
         # Skip people's nicks.
         next if exists $self->{stats}->{lines}{$word};
+        next if (length($word) < $self->{cfg}->{wordlength});
         $usages{$word} = $self->{stats}->{wordcounts}{$word};
     }
 

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

@@ -438,7 +438,7 @@ sub _parse_words
     foreach my $word (split(/[\s,!?.:;)(\"]+/, $saying)) {
         $stats->{words}{$nick}++;
         # remove uninteresting words
-        next unless (length($word) >= $self->{cfg}->{wordlength});
+        # next unless (length($word) >= $self->{cfg}->{wordlength});
         next if ($self->{cfg}->{ignoreword}{$word});
 
         # ignore contractions