# -*- 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):
    t=open(fn,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); return html.unescape(re.sub(r"\s+"," ",t))
t=clean("_17_biosci-admissions.txt")
i=t.find("Applying to the Program")
print("="*15,"biosci-adm body")
print(t[i:i+2400])
print("\n")
for kw in ["GRE","TOEFL","IELTS","deadline","Deadline","August","May","June","GPA","prerequisite","recommendation","essay","fee","STEM","part-time","online"]:
    for m in re.finditer(re.escape(kw),t):
        s=max(0,m.start()-55); e=min(len(t),m.end()+110)
        print(f"  [{kw}] {t[s:e]}"); break
b=clean("_17_vandy-bme.txt")
print("\n"+"="*15,"bme deadline/credit")
for kw in ["application deadline","Fall semester","30 hours","30 credit","thesis","MS thesis","stipend","TOEFL","100","GRE","not required","Master of Science","tuition","STEM"]:
    for m in re.finditer(re.escape(kw),b,re.I):
        s=max(0,m.start()-60); e=min(len(b),m.end()+150)
        print(f"  [{kw}] {b[s:e]}"); break
