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

Made the minimum wordlength in 'most referenced words' configurable

Morten Brix Pedersen 25 лет назад
Родитель
Сommit
600922ce84
1 измененных файлов с 6 добавлено и 4 удалено
  1. 6 4
      pisg.pl

+ 6 - 4
pisg.pl

@@ -24,9 +24,9 @@ use Getopt::Long;
 my ($channel, $logfile, $format, $network, $outputfile, $maintainer,
 my ($channel, $logfile, $format, $network, $outputfile, $maintainer,
 $pagehead, $usersfile, $imagepath, $logdir, $lang, $langfile, $bgcolor,
 $pagehead, $usersfile, $imagepath, $logdir, $lang, $langfile, $bgcolor,
 $text, $hbgcolor, $hcolor, $hicell, $hicell2, $tdcolor, $tdtop, $link,
 $text, $hbgcolor, $hcolor, $hicell, $hicell2, $tdcolor, $tdtop, $link,
-$vlink, $hlink, $headline, $rankc, $minquote, $maxquote, $activenicks,
-$activenicks2, $topichistory, $pic1, $pic2, $nicktracking, $timeoffset,
-$version, $debug, $debugfile);
+$vlink, $hlink, $headline, $rankc, $minquote, $maxquote, $wordlength,
+$activenicks, $activenicks2, $topichistory, $pic1, $pic2, $nicktracking,
+$timeoffset, $version, $debug, $debugfile);
 
 
 # Values that _MUST_ be set below (unless you pass them on commandline)
 # Values that _MUST_ be set below (unless you pass them on commandline)
 $channel = "#channel";		# The name of your channel.
 $channel = "#channel";		# The name of your channel.
@@ -73,6 +73,8 @@ $pic2 = "pipe-purple.png";      # Bar-graphic-file for top-times
 # Other things that you might set, but not everyone cares about them
 # Other things that you might set, but not everyone cares about them
 $minquote = "25";		# Minimal value of letters for a random quote
 $minquote = "25";		# Minimal value of letters for a random quote
 $maxquote = "65";		# Maximum value of letters for a random quote
 $maxquote = "65";		# Maximum value of letters for a random quote
+$wordlength = "5";		# The minimum number of chars an interesting
+				# word may be (in 'most referenced words')
 $activenicks = "25";		# Number of nicks to show in the 'top 25'
 $activenicks = "25";		# Number of nicks to show in the 'top 25'
 $activenicks2 = "30";		# Nicks to show in 'these didnt make it...'
 $activenicks2 = "30";		# Nicks to show in 'these didnt make it...'
 $topichistory = "3";		# How many topics to show in 'latest topics'
 $topichistory = "3";		# How many topics to show in 'latest topics'
@@ -369,7 +371,7 @@ sub parse_file
 
 
                     foreach my $word (split(/[\s,!?.:;)(]+/, $saying)) {
                     foreach my $word (split(/[\s,!?.:;)(]+/, $saying)) {
                         # remove uninteresting words
                         # remove uninteresting words
-                        next unless (length($word) > 5);
+                        next unless (length($word) > $wordlength);
                         # ignore contractions
                         # ignore contractions
                         next if ($word =~ m/'..?$/);
                         next if ($word =~ m/'..?$/);