|
From: <jgr...@us...> - 2003-10-17 06:13:51
|
Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv25504/Classifier
Modified Files:
Bayes.pm
Log Message:
Entries in the table files with a count of 0 screw up the upgrade process, fix that and add a test case
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.212
retrieving revision 1.213
diff -C2 -d -r1.212 -r1.213
*** Bayes.pm 16 Oct 2003 17:55:12 -0000 1.212
--- Bayes.pm 17 Oct 2003 06:12:03 -0000 1.213
***************
*** 714,718 ****
if ( /^([^\s]+) (\d+)$/ ) {
! $self->set_value_( $bucket, $1, $2 );
} else {
$self->log_( "Found entry in corpus for $bucket that looks wrong: \"$_\" (ignoring)" );
--- 714,720 ----
if ( /^([^\s]+) (\d+)$/ ) {
! if ( $2 != 0 ) {
! $self->set_value_( $bucket, $1, $2 );
! }
} else {
$self->log_( "Found entry in corpus for $bucket that looks wrong: \"$_\" (ignoring)" );
***************
*** 757,767 ****
if ( /^([^\s]+) (\d+)$/ ) {
! if ( $self->get_base_value_( $bucket, $1 ) != $2 ) {
! print "\nUpgrade error for word $1 in bucket $bucket.\nShutdown POPFile and rerun.\n";
! $upgrade_failed = 1;
! last;
}
- $bucket_total += $2;
- $bucket_unique += 1;
} else {
$self->log_( "Found entry in corpus for $bucket that looks wrong: \"$_\" (ignoring)" );
--- 759,771 ----
if ( /^([^\s]+) (\d+)$/ ) {
! if ( $2 != 0 ) {
! if ( $self->get_base_value_( $bucket, $1 ) != $2 ) {
! print "\nUpgrade error for word $1 in bucket $bucket.\nShutdown POPFile and rerun.\n";
! $upgrade_failed = 1;
! last;
! }
! $bucket_total += $2;
! $bucket_unique += 1;
}
} else {
$self->log_( "Found entry in corpus for $bucket that looks wrong: \"$_\" (ignoring)" );
|