Advertisement
Guest User

Untitled

a guest
May 9th, 2015
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.87 KB | None | 0 0
  1. diff --git a/findspam.py b/findspam.py
  2. index a19c988..7a24b7b 100644
  3. --- a/findspam.py
  4. +++ b/findspam.py
  5. @@ -1,4 +1,4 @@
  6. -<U+FEFF># -*- coding: utf-8 -*-
  7. +# -*- coding: utf-8 -*-
  8.  import regex
  9.  import phonenumbers
  10.  
  11. @@ -26,7 +26,7 @@ class FindSpam:
  12.                      "JobsTribune", "join the illuminati", "Brorsoft", "Remo Recover",
  13.                      "kinnaristeel", "clash of (clan|stone)s? (cheats?|tricks?|gems?)",
  14.                      r"(?x:B [\s_]* A [\s_]* M \W{0,5} W [\s_]* A [\s_]* R [\s_]* \.? [\s_]* C [\s_]* O [\s_]* M)",
  15. -                    "slumber pm", "1-844-400-7325"]
  16. +                    "slumber pm", "1-844-400-7325", "male enhancement"]
  17.      bad_keywords_nwb = [u"ಌ", "babyliss", "garcinia", "acai ?berry",  # "nwb" == "no word boundary"
  18.                          "aging ?cream", u"오피", "b ?a ?m ?((w ?o ?w)|(w ?a ?r))"]
  19.      blacklisted_websites = ["online ?kelas", "careyourhealths", "wowtoes",
  20. diff --git a/test/test_spamhandling.py b/test/test_spamhandling.py
  21. index 342d204..05ceecc 100644
  22. --- a/test/test_spamhandling.py
  23. +++ b/test/test_spamhandling.py
  24. @@ -27,7 +27,8 @@ with open("test/data_test_spamhandling.txt", "r") as f:
  25.      ('Is it unfair to regrade prior work after detecting cheating?', '', 'Village', '', False),
  26.      ('Inner workings of muscles', '', '', 'fitness.stackexchange.com', False),
  27.      ('Cannot access http://stackoverflow.com/ with proxy enabled', '', '', 'superuser.com', False),
  28. -    ('kkkkkkkkkkkkkkkkkkkkkkkkkkkk', '<p>bbbbbbbbbbbbbbbbbbbbbb</p>', '', 'stackoverflow.com', True)
  29. +    ('kkkkkkkkkkkkkkkkkkkkkkkkkkkk', '<p>bbbbbbbbbbbbbbbbbbbbbb</p>', '', 'stackoverflow.com', True),
  30. +    ('Enhance SD Male Enhancement Supplements', '', '', '', True)
  31.  ])
  32.  def test_check_if_spam(title, body, username, site, match):
  33.      # We can't check blacklists/whitelists in tests, so these are set to their default values
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement