Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv9558
Modified Files:
Bayes.pm
Log Message:
Allow $ and @ in magnets
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.156
retrieving revision 1.157
diff -C2 -d -r1.156 -r1.157
*** Bayes.pm 26 Jun 2003 17:36:17 -0000 1.156
--- Bayes.pm 30 Jun 2003 14:57:52 -0000 1.157
***************
*** 592,601 ****
# You cannot use @ or $ inside a \Q\E regular expression and hence
# we have to change the $magnet and the text we are comparing against
! # by changing the $ and @ signs to .
my $noattype;
$noattype = $self->{parser__}->get_header($type);
! $noattype =~ s/[@\$]/\./g;
for my $magnet (sort keys %{$self->{magnets__}{$bucket}{$type}}) {
--- 592,603 ----
# You cannot use @ or $ inside a \Q\E regular expression and hence
# we have to change the $magnet and the text we are comparing against
! # by changing the $ and @ signs to special forms which I hope
! # never really appear
my $noattype;
$noattype = $self->{parser__}->get_header($type);
! $noattype =~ s/@/__POPFILE_AT__/g;
! $noattype =~ s/\$/__POPFILE_DOLLAR__/g;
for my $magnet (sort keys %{$self->{magnets__}{$bucket}{$type}}) {
***************
*** 603,607 ****
$regex = $magnet;
! $regex =~ s/[@\$]/\./g;
if ( $noattype =~ m/\Q$regex\E/i ) {
--- 605,610 ----
$regex = $magnet;
! $regex =~ s/@/__POPFILE_AT__/g;
! $regex =~ s/\$/__POPFILE_DOLLAR__/g;
if ( $noattype =~ m/\Q$regex\E/i ) {
|