diff --git a/judge_message b/judge_message index bf76950..3ab99a2 100755 --- a/judge_message +++ b/judge_message @@ -73,17 +73,13 @@ def extract_features(msgid, verbose): interesting_evidence = [] seen = [] for e in evidence: - for s in seen: - if e["type"] == s["type"] and (e["feature"] in s["feature"] or s["feature"] in e["feature"]): - break - else: + new_comp = [] + for c in components[e["type"]]: + new_comp += c.split(e["feature"]) + if len(new_comp) > len(components[e["type"]]): + # we found it somewhere interesting_evidence.append(e) - seen.append(e) - ln = len(e["feature"]) - if ln >= 6: - seen.append({"type": e["type"], "feature": e["feature"][0 : ln // 3]}) - seen.append({"type": e["type"], "feature": e["feature"][ln // 3 : ln * 2 // 3]}) - seen.append({"type": e["type"], "feature": e["feature"][ln * 2 // 3 : ln]}) + components[e["type"]] = new_comp if len(interesting_evidence) >= EVIDENCE_MAX: break p1 = 1