Update of /cvsroot/popfile/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv21667
Modified Files:
bayes.pl
Log Message:
Updated bayes.pl to work with POPFile's object structure
Index: bayes.pl
===================================================================
RCS file: /cvsroot/popfile/engine/bayes.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** bayes.pl 14 Jun 2003 21:10:12 -0000 1.16
--- bayes.pl 26 Jun 2003 17:48:22 -0000 1.17
***************
*** 10,13 ****
--- 10,16 ----
use strict;
use Classifier::Bayes;
+ use POPFile::Configuration;
+ use POPFile::MQ;
+ use POPFile::Logger;
# main
***************
*** 15,27 ****
if ( $#ARGV == 0 )
{
my $b = new Classifier::Bayes;
! if ( $b->initialize() == 0 ) {
! die "Failed to start while initializing the classifier module";
! }
! $b->{debug} = 1;
! $b->{parser}->{debug} = 0;
! $b->load_word_matrix();
my @files = glob $ARGV[0];
--- 18,46 ----
if ( $#ARGV == 0 )
{
+ my $c = new POPFile::Configuration;
+ my $mq = new POPFile::MQ;
+ my $l = new POPFile::Logger;
my $b = new Classifier::Bayes;
! $c->configuration( $c );
! $c->mq( $mq );
! $c->logger( $l );
! $l->configuration( $c );
! $l->mq( $mq );
! $l->logger( $l );
!
! $l->initialize();
!
! $mq->configuration( $c );
! $mq->mq( $mq );
! $mq->logger( $l );
!
! $b->configuration( $c );
! $b->mq( $mq );
! $b->logger( $l );
!
! $b->initialize();
! $b->start();
my @files = glob $ARGV[0];
***************
*** 31,36 ****
}
! foreach my $word (keys %{$b->{parser}->{words}}) {
! print "$word $b->{parser}->{words}{$word}\n";
}
}
--- 50,55 ----
}
! foreach my $word (keys %{$b->{parser__}->{words__}}) {
! print "$word $b->{parser__}->{words__}{$word}\n";
}
}
|