Skip to content

Instantly share code, notes, and snippets.

@nh7a
Created December 30, 2011 07:06
Show Gist options
  • Save nh7a/1538400 to your computer and use it in GitHub Desktop.
Save nh7a/1538400 to your computer and use it in GitHub Desktop.
def has_nothing_to_do_with_n(text):
if type(text) == unicode:
text = text.encode('utf-8')
reason = False
if len(text) < 5:
reason = 'too short'
elif text[2:].startswith(('\xc3','.','!','@','_','-','~','\xe9\x9f\xbf')):
reason = 'not for n'
elif len(text.split('@')) > 5:
reason = '#ff'
if reason:
logging.debug("IGNORE: %s: %r", reason, text)
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment