diff --git a/app/services/spamfilter_service.rb b/app/services/spamfilter_service.rb index c0493a741..924e53117 100644 --- a/app/services/spamfilter_service.rb +++ b/app/services/spamfilter_service.rb @@ -11,6 +11,15 @@ def spam? def ham? labelName == 'Ham' end + + def spamminess + if spam? + confidence + else + # Ham has a hamminess score (inverse of spamminess) + 1.0 - confidence + end + end end NYCKEL_URL = 'https://www.nyckel.com'