Created
December 30, 2011 07:06
-
-
Save nh7a/1538400 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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