read-trans: Tanglish explainer for YouTube transcripts, with eval
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d277746c39
commit
653b39abfa
7 files changed
+150
No files matched your search
@@ -0,0 +1,24 @@
|
||||
"""Check a read-trans output file: python check_output.py output.md (exit 1 on failure)."""
|
||||
import re, sys
|
||||
|
||||
text = open(sys.argv[1], encoding="utf-8").read()
|
||||
low = text.lower()
|
||||
fails = []
|
||||
|
||||
def need(ok, msg):
|
||||
if not ok:
|
||||
fails.append(msg)
|
||||
|
||||
for h in ("video enna solluthu", "medium explanation", "final takeaway", "projects-ku enna pannanum"):
|
||||
need(h in low, f"missing section: {h}")
|
||||
need(not re.search(r"[\u0b80-\u0bff]", text), "Tamil script found (should be Tanglish)")
|
||||
need(not re.search(r"\b\d+:\d{2}\b", text), "timestamp leaked into output")
|
||||
need(not re.search(r"chapter \d", low), "chapter marker leaked")
|
||||
need("```" in text, "no ready-to-copy prompt block in the projects section")
|
||||
need(len(re.findall(r"\b(irukku|panna|pannanum|solluthu|romba|idhu|athu|aana|illa)\b", low)) >= 8, "not enough Tanglish words")
|
||||
need("subscribe" not in low, "sponsor/subscribe plug repeated")
|
||||
need("$137" in text and "$22" in text, "model costs missing")
|
||||
need(len(text.split()) < 700, "too long (>700 words)")
|
||||
|
||||
print("\n".join(["FAIL: " + f for f in fails]) or "PASS")
|
||||
sys.exit(1 if fails else 0)
|
||||
Reference in new issue
Block a user