# -*- coding: utf-8 -*-
import io, sys, os, re, html
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
for name in ["vandy-mfin","vandy-mm","vandy-mmkt"]:
    t=open("_17_"+name+".txt",encoding="utf-8").read()
    t=html.unescape(re.sub(r"<script.*?</script>","",t,flags=re.S))
    t=html.unescape(re.sub(r"<style.*?</style>","",t,flags=re.S))
    t=re.sub(r"<[^>]+>"," ",t); t=html.unescape(re.sub(r"\s+"," ",t))
    print("="*25,name,"len",len(t))
    for kw in ["STEM","credit","months","part-time","online","GRE","GMAT","TOEFL","IELTS","deadline","Round","tuition","GPA","prerequisite","full-time","10 months","12 months","9 months","course","salary","employed","acceptance"]:
        for m in re.finditer(kw,t,re.I):
            s=max(0,m.start()-70); e=min(len(t),m.end()+110)
            print(f"  [{kw}] ...{t[s:e]}...")
            break
