Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6174/Classifier
Modified Files:
Bayes.pm
Log Message:
Avoid some unnecessary warnings
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.359
retrieving revision 1.360
diff -C2 -d -r1.359 -r1.360
*** Bayes.pm 30 Mar 2008 10:22:36 -0000 1.359
--- Bayes.pm 5 Apr 2008 11:02:20 -0000 1.360
***************
*** 639,643 ****
return undef if ( !defined( $userid ) );
! if ( $wc > 0 ) {
$self->{not_likely__}{$userid} = -log( 10 * $wc );
--- 639,643 ----
return undef if ( !defined( $userid ) );
! if ( defined $wc && $wc > 0 ) {
$self->{not_likely__}{$userid} = -log( 10 * $wc );
***************
*** 1887,1891 ****
for my $bucket (@buckets) {
! if ( $self->{bucket_start__}{$userid}{$bucket} != 0 ) {
$score{$bucket} = $self->{bucket_start__}{$userid}{$bucket};
$matchcount{$bucket} = 0;
--- 1887,1891 ----
for my $bucket (@buckets) {
! if ( defined $self->{bucket_start__}{$userid}{$bucket} && $self->{bucket_start__}{$userid}{$bucket} != 0 ) {
$score{$bucket} = $self->{bucket_start__}{$userid}{$bucket};
$matchcount{$bucket} = 0;
***************
*** 2019,2023 ****
my %raw_score;
! my $base_score = $score{$ranking[0]};
my $total = 0;
--- 2019,2023 ----
my %raw_score;
! my $base_score = defined $ranking[0] ? $score{$ranking[0]} : 0;
my $total = 0;
***************
*** 3433,3437 ****
$h = $self->db_()->prepare(
! "select bucket1.id, bucket2.id from buckets as bucket1, buckets as bucket2
where bucket1.userid = $id and bucket1.name = bucket2.name and bucket2.userid = $clid;" );
$h->execute;
--- 3433,3437 ----
$h = $self->db_()->prepare(
! "select bucket1.id, bucket2.id from buckets as bucket1, buckets as bucket2
where bucket1.userid = $id and bucket1.name = bucket2.name and bucket2.userid = $clid;" );
$h->execute;
***************
*** 3458,3462 ****
my $val = $self->db_()->quote( $bucket_params{$bucketid}{$btid} );
$self->db_()->do(
! "insert into bucket_params ( bucketid, btid, val )
values ( $bucketid, $btid, $val );" );
}
--- 3458,3462 ----
my $val = $self->db_()->quote( $bucket_params{$bucketid}{$btid} );
$self->db_()->do(
! "insert into bucket_params ( bucketid, btid, val )
values ( $bucketid, $btid, $val );" );
}
***************
*** 4128,4134 ****
$self->db_()->do( # PROFILE BLOCK START
! "delete from buckets where
! buckets.userid = $userid and
! buckets.name = '$bucket' and
buckets.pseudo = 0;" ); # PROFILE BLOCK STOP
$self->db_update_cache__( $session );
--- 4128,4134 ----
$self->db_()->do( # PROFILE BLOCK START
! "delete from buckets where
! buckets.userid = $userid and
! buckets.name = '$bucket' and
buckets.pseudo = 0;" ); # PROFILE BLOCK STOP
$self->db_update_cache__( $session );
|