From: <jgr...@us...> - 2003-03-05 20:06:54
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1:/tmp/cvs-serv23796/Classifier Modified Files: Bayes.pm Log Message: Added delete_bucket and rename_bucket APIs and hooked them up to the UI; ecount and mcount become global values Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** Bayes.pm 4 Mar 2003 22:01:20 -0000 1.112 --- Bayes.pm 5 Mar 2003 20:06:15 -0000 1.113 *************** *** 1100,1103 **** --- 1100,1148 ---- # --------------------------------------------------------------------------------------------- # + # delete_bucket + # + # Deletes a bucket + # + # $bucket Name of the bucket to delete + # + # --------------------------------------------------------------------------------------------- + + sub delete_bucket + { + my ( $self, $bucket ) = @_; + + my $bucket_directory = $self->config_( 'corpus' ) . "/$bucket"; + + unlink( "$bucket_directory/table" ); + unlink( "$bucket_directory/color" ); + unlink( "$bucket_directory/params" ); + unlink( "$bucket_directory/magnets" ); + rmdir( $bucket_directory ); + + $self->load_word_matrix_(); + } + + # --------------------------------------------------------------------------------------------- + # + # rename_bucket + # + # Renames a bucket + # + # $old_bucket The old name of the bucket + # $new_bucket The new name of the bucket + # + # --------------------------------------------------------------------------------------------- + + sub rename_bucket + { + my ( $self, $old_bucket, $new_bucket ) = @_; + + rename($self->config_( 'corpus' ) . "/$old_bucket" , $self->config_( 'corpus' ) . "/$new_bucket"); + + $self->load_word_matrix_(); + } + + # --------------------------------------------------------------------------------------------- + # # add_message_to_bucket # |