"""Shared feature definition (copied from features.py).""" import re def f(p): t = p["text"]; tl = t.lower() tags = len(re.findall(r"#\w+", t)) return { "question": "?" in t, "asks_reader": bool(re.search(r"\b(you|your|anyone|what do|how do you|would you|thoughts|feedback|which)\b", tl)) and "?" in t, "image/video": p["image"], "link": p["link"], "number": bool(re.search(r"\d", t)), "first person story (I/my)": bool(re.search(r"\b(i|i'm|i've|my)\b", tl)), "money ($/MRR/revenue)": bool(re.search(r"\$|mrr|revenue|sales|paying|customers", tl)), "launch/promo words": bool(re.search(r"\b(launch|launched|check out|try it|sign up|waitlist|link in|free trial)\b", tl)), "mentions AI": bool(re.search(r"\b(ai|llm|gpt|claude|agent)\b", tl)), "5+ hashtags": tags >= 5, "short (<120 chars)": len(t) < 120, "long (>250 chars)": len(t) > 250, "bot label": p["bot"], }