-
Notifications
You must be signed in to change notification settings - Fork 0
/
classificar
executable file
·65 lines (57 loc) · 1.9 KB
/
classificar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#
################################################################################
# #
# Script que executa o classificador de emails usando machine learning #
# #
# Author: Andre L. Abrantes #
# #
################################################################################
function usage()
{
cat << EOF
USAGE: $0 [options] <help|verbose> $1 [tecnics] <NaiveBayes|SMO> $2 train_path $3 test_path
Script que executa um detector de spam usando machine learning!
OPTIONS:
-h ou -help Mostra esta mensagem
-v ou -verbose Verbose, mostra a classificação de cada email.
TECNICS:
NaiveBayes Usa o algorítmo NaiveBayes para treinar e executar os testes
SMO Usa o algorítmo SMO para treinar e executar os testes
EOF
}
while true
do
case "$1" in
-h|-help)
usage
exit 0
shift
;;
-v|verbose)
if ! [ -e "$4" ] ; then
usage
exit 0
fi
java -jar classificador.jar -v "$2" "$3" "$4"
exit $?
shift
;;
SMO|NaiveBayes)
if ! [ -e "$3" ] ; then
usage
exit 0
fi
java -jar classificador.jar "$1" "$2" "$3"
exit $?
;;
--)
shift
break
;;
*)
echo $OPTARG
exit $?
;;
esac
done