# -*- 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))
def show(fn,kws,span=220):
    t=clean(fn); print("="*18,fn)
    for kw in kws:
        for m in re.finditer(re.escape(kw),t,re.I):
            s=max(0,m.start()-60); e=min(len(t),m.end()+span); print(f"[{kw}] …{t[s:e]}\n"); break
show("_21_c6cfbd0.txt",["MHS students do not write a thesis","culminating","minimum","credits","on-site","on campus","Baltimore","elective"])
show("_21_c682af5.txt",["master's thesis","second year","part-time","minimum","credits","research","elective"])
show("_21_c1b6b67.txt",["Thesis Requirement","Total Credits","Foundational","elective","concentration","track"])
show("_21_cb5871a.txt",["Capstone","GRE","credits","elective","concentration","global health","admission"])
show("_21_c42b996.txt",["64 course credits","Capstone","mentored","on-site","online","part-time","elective"])
