# -*- coding: utf-8 -*-
import io, sys, os, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
for w in ["ds","gd","se","hm","ml"]:
    t=open(f"_usc2_{w}.txt",encoding="utf-8").read()
    print("#"*100); print("###",w,"len",len(t))
    # 课程代码
    codes=sorted(set(re.findall(r"\b(?:CSCI|DSCI|EE|CE|CS|AM|MATH|BME|PM|INF|CS)\s?\d{3}[a-z]?\b",t)))
    print("课程代码:",codes)
    # Application Criteria 段
    for anchor in ["APPLICATION CRITERIA","Application Criteria","APPLICATION REQUIREMENTS","Prerequisite","Recommended preparation","CAREER OUTCOMES","Career Outcomes","Top Employers","Average Reported Salary","Companies & Job"]:
        i=t.find(anchor)
        if i>=0:
            print(f"\n  [{anchor}] …{t[i:i+420]}…")
