Skip to content

Commit

Permalink
Add spamminess method to SpamfilterService
Browse files Browse the repository at this point in the history
  • Loading branch information
NuckChorris committed Dec 8, 2024
1 parent 7db68ae commit 85d2150
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/services/spamfilter_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 85d2150

Please sign in to comment.