Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
meh solution in Clear category for Stressful Subject by Leonix
import re, string
def is_stressful(subj):
# all uppercase?
if not (set(subj) & set(string.ascii_lowercase)):
return True
# ends by 3 exclamation marks?
if subj[-3:] == '!!!':
return True
# contains a red word?
regex = '|'.join('+'.join(word) for word in ["help", "asap", "urgent"])
if re.search(regex, re.sub('[^a-zA-Z]', '', subj), flags=re.IGNORECASE):
return True
return False
June 24, 2019
Comments: