Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv17280/Classifier
Modified Files:
Bayes.pm
Log Message:
change handling of bayes::{scores__} to reduce burden on forking
(Disables saving of scores where not needed, clears scores after where enabled)
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** Bayes.pm 15 Apr 2003 21:20:17 -0000 1.124
--- Bayes.pm 16 Apr 2003 00:59:57 -0000 1.125
***************
*** 37,41 ****
# Set this to 1 to get scores for individual words in message detail
! $self->{wordscores__} = 1;
# Just our hostname
--- 37,41 ----
# Set this to 1 to get scores for individual words in message detail
! $self->{wordscores__} = 0;
# Just our hostname
***************
*** 1468,1470 ****
--- 1468,1516 ----
}
+ # ---------------------------------------------------------------------------------------------
+ #
+ # get_scores - Gets the HTMLized (for now) listing of word scores
+ #
+ # ---------------------------------------------------------------------------------------------
+
+ sub get_scores
+ {
+ my ( $self ) = @_;
+
+ return $self->{scores__};
+ }
+
+ # ---------------------------------------------------------------------------------------------
+ #
+ # clear_scores - clears the listing of word scores
+ #
+ # ---------------------------------------------------------------------------------------------
+
+ sub clear_scores
+ {
+ my ( $self ) = @_;
+
+ $self->{scores__} = '';
+
+ }
+
+
+ # ---------------------------------------------------------------------------------------------
+ #
+ # toggle_score - Enables and disables the saving of word scores
+ #
+ # $value 1 for enabled, 0 for disabled
+ #
+ # ---------------------------------------------------------------------------------------------
+
+ sub toggle_score
+ {
+ my ( $self, $value ) = @_;
+
+ $self->{wordscores__} = $value;
+ }
+
+
+
1;
+
|