2 * A FilterResult encapsulates the result of a filter made by checking a mail.
4 public class FilterResult {
6 * This value is used if type is ERROR or UNKNOWN.
8 public double NO_RESULT;
11 * A result value greater or equal this value indicates that the filter has
14 public int SPAM_THRESHOLD;
15 public int ABSOLUTE_SPAM;
16 public int ABSOLUTE_HAM;
18 //public double result; // the result, a value between -1 (ham) and 1000 (spam),
19 // negative values for "error", "unknown" etc.
21 // -----------------------------------------------------------------------------
23 public FilterResult(double result) {
28 //this.result = result;
31 public FilterResult() {
38 public boolean getResult(int[] confidenceVals) {
39 int[] res = new int[3];
40 for(int i=0; i<confidenceVals.length; i++) {
41 if(confidenceVals[i] < 0)
43 if(confidenceVals[i] >= 0 && confidenceVals[i] < 500)
45 if(confidenceVals[i] > SPAM_THRESHOLD)
50 for(int i=0; i<3;i++) {
51 if(res[i] > maxVotes) {
63 System.out.println("Err: getResult() Control shouldn't come here\n");
68 public void addProperty(String key, String value) {
69 properties.put(key,value);
72 public String getProperty(String key) {
73 return properties.get(key);
76 public HashMap<String,String> getProperties() {