# -*- 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")
def clean(fn):
    raw=open(fn,"rb").read().decode("utf-8","ignore")
    raw=html.unescape(re.sub(r"<script.*?</script>","",raw,flags=re.S)); raw=html.unescape(re.sub(r"<style.*?</style>","",raw,flags=re.S))
    t=re.sub(r"<[^>]+>"," ",raw); return html.unescape(re.sub(r"\s+"," ",t))
t=clean("_19_cs_mscs.txt")
for kw in ["GRE","Graduate Record","fee","Fee","recommend","statement","statement of purpose","transcript","prerequisite","Prerequisite","background","bachelor","tuition","cost","funding","stipend","Focus Areas","track"]:
    for m in re.finditer(re.escape(kw),t):
        s=max(0,m.start()-60); e=min(len(t),m.end()+170); print(f"[{kw}] …{t[s:e]}\n")
        break
print("===== FULL =====")
print(t)
