~ubuntu-branches/ubuntu/lucid/spamassassin/lucid-proposed

« back to all changes in this revision

Viewing changes to masses/bayes-testing/bayes-tcr-from-freqs

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2006-12-06 15:25:33 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061206152533-0lq5d0c8f7le7ugq
Tags: 3.1.7-1ubuntu1
* Merge from Debian unstable. The remaining Ubuntu changes are:
  - debian/control:
    + libmail-spf-query-perl from Recommends to Depends for spamassassin 
      binary (Ubuntu: #28486)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
 
3
 
my $args = join (' ',@ARGV);
4
 
my $ss = 0;
5
 
my $sh = 0;
6
 
my $hs = 0;
7
 
my $hh = 0;
8
 
 
9
 
while (<STDIN>) {
10
 
  my ($overall, $spam, $ham, $so, $rank, $score, $name) = split;
11
 
  next if (!defined $name);
12
 
  next if ($name !~ /BAYES_(\d+)/);
13
 
  my $brange = $1;
14
 
 
15
 
  if ($score < 0) {
16
 
    $sh += $spam;
17
 
    $hh += $ham;
18
 
  } elsif ($score == 0) {
19
 
    next;               # ignore
20
 
  } else {
21
 
    $ss += $spam;
22
 
    $hs += $ham;
23
 
  }
24
 
}
25
 
 
26
 
$ss *= 10000;   # promote to integers
27
 
$sh *= 10000;
28
 
$hs *= 10000;
29
 
$hh *= 10000;
30
 
 
31
 
$cmd = "./fp-fn-to-tcr $args -spam $ss -ham $hh -fn $sh -fp $hs";
32
 
print "TCR for bayes:\n[$cmd]\n";
33
 
system $cmd;
34