# -*- 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=240):
    t=clean(fn); print("="*20,fn)
    for kw in kws:
        m=re.search(re.escape(kw),t)
        if m:
            s=max(0,m.start()-70); e=min(len(t),m.end()+span); print(f"[{kw}] …{t[s:e]}\n")
show("_19_JHU-CBE-MSE.txt",["Essay-Based Option","Research (PI) Option","three to four semesters","focus areas","Kinetics","ethics"])
show("_19_JHU-Civil-MSE.txt",["MSE with Thesis Requirements","eight cour","first three semesters","fire engineering","probabilistic"])
show("_19_JHU-EngMgmt-MS.txt",["16.5 credit","fifteen credits","cohort","Professional Presentations","Engineering for Professionals","MSEM"])
show("_19_JHU-HSI-MS.txt",["24 months","36 credits","Year 1","thesis","rotations","February 15"])
