-def actions_coverage(actions, text):
- for name, action in actions:
- if action["message"] == None or action["message"] == "NO_MESSAGE":
- action["message"] = True
- if action["message"] != True:
- if search(action["message"], text):
- action["message"] = True
+def threshold_coverage(classes, text):
+ # works for class thresholds and turn threshold, which have a "message"
+ # property
+ for i, msg in enumerate(classes):
+ if msg["message"] == None:
+ msg["message"] = True
+ elif msg["message"] != True:
+ if search(msg["message"], text):
+ msg["message"] = True
+
+def specials_actions_coverage(items, text):
+ # works for actions or specials
+ for name, item in items:
+ if item["message"] == None or item["message"] == "NO_MESSAGE":
+ item["message"] = True
+ if item["message"] != True:
+ if search(item["message"], text):
+ item["message"] = True