Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clear solution in Clear category for Stressful Subject by MBM_1607
import re
from string import punctuation
RED_WORDS = ("help", "asap", "urgent")
def is_stressful(subj):
"""
recognize stressful subject
"""
if subj.isupper():
return True
elif subj.endswith("!!!"):
return True
elif any(re.search(f'+[{punctuation}]*'.join(char for char in word), subj.lower()) for word in RED_WORDS):
return True
return False
Nov. 9, 2019