Example #1
0
        public override float CalculateSpamValue(Message sentMessage, bool keepCached = true)
        {
            switch (AggregateMethod)
            {
            case HeuristicAggregateMethod.Sum:
                return(Heuristics.Sum(d => d.Key.CalculateSpamValue(sentMessage, keepCached) * d.Value));

            case HeuristicAggregateMethod.Average:
                return(Heuristics.Average(d => d.Key.CalculateSpamValue(sentMessage, keepCached) * d.Value));

            case HeuristicAggregateMethod.Max:
                return(Heuristics.Max(d => d.Key.CalculateSpamValue(sentMessage, keepCached) * d.Value));

            default:
                return(Heuristics.Sum(d => d.Key.CalculateSpamValue(sentMessage, keepCached) * d.Value));
            }
        }