File: classify

package info (click to toggle)
dbacl 1.12-2.2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 3,740 kB
  • sloc: ansic: 16,594; sh: 7,963; makefile: 244; yacc: 167; lex: 78; awk: 24; xml: 17; perl: 8
file content (12 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
. ./share/dbacl/TREC/OPTIONS
line=`./bin/dbacl -m $DBACL_COPTS -c ./db/ham -c ./db/spam $1 2>>stderr.log`
hscore=`expr "$line" : "$DBACL_CHAM" \| 0`
sscore=`expr "$line" : "$DBACL_CSPAM" \| 0`
score=`echo "$DBACL_SGN ($hscore - $sscore)" | bc`
case $score in
0) class='ham' ;;
-*) class='ham' ;;
*) class='spam' ;;
esac
echo class=$class score=$score