3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

cjeopardy filter: Make comma substitution global

This commit is contained in:
Pragmatic Software 2017-02-21 05:50:02 -08:00
parent 1e4e101386
commit e4ca260aaf

View File

@ -5,7 +5,7 @@ use strict;
use Fcntl qw(:flock); use Fcntl qw(:flock);
my $MAX_WORDS = 3; my $MAX_WORDS = 15;
my $CJEOPARDY_DATA = 'data/cjeopardy.dat'; my $CJEOPARDY_DATA = 'data/cjeopardy.dat';
my $CJEOPARDY_FILTER = 'data/cjeopardy.filter'; my $CJEOPARDY_FILTER = 'data/cjeopardy.filter';
@ -28,7 +28,7 @@ if (not length $filter) {
my $words = <$fh>; my $words = <$fh>;
close $fh; close $fh;
chomp $words; chomp $words;
$words =~ s/,/, /; $words =~ s/,/, /g;
$words =~ s/, ([^,]+)$/ or $1/; $words =~ s/, ([^,]+)$/ or $1/;
print "Filter active. Questions containing $words will be skipped. Usage: filter <comma or space separated list of words> or `filter clear` to clear.\n"; print "Filter active. Questions containing $words will be skipped. Usage: filter <comma or space separated list of words> or `filter clear` to clear.\n";
exit; exit;