File: gen-score-freqs-gnuplot-table

package info (click to toggle)
spamassassin 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,724 kB
  • sloc: perl: 89,143; ansic: 5,193; sh: 3,737; javascript: 339; sql: 295; makefile: 209; python: 49
file content (18 lines) | stat: -rwxr-xr-x 311 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

my %buckets = ();
my $highest = 0;
my $lowest = 0;

while (<>) {
  /^.\s+(-?\d+)\s+/ or next;
  $buckets{$1}++;
  if ($1 > $highest) { $highest = $1; }
  if ($1 < $lowest) { $lowest = $1; }
}

for my $i ($lowest..$highest) {
  my $count = $buckets{$i};
  $count ||= 0;
  print "$i $count\n";
}