# -*- 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")
idx=open("index_main.html",encoding="utf-8").read()
seg=idx[idx.find("const PROGRAMS="):idx.find("const CATD=")]

# 检查 UT 条目里是否已含这些方向
keywords=["computer-science","applied-computing","public-health","kinesiology","exercise-sciences",
          "materials-science","material-science","nutrition","nutritional-sciences","landscape-architecture",
          "psychology","sociology","anthropology","geography","forestry","music","art-history","philosophy",
          "nursing","social-work","speech-language","educational","higher-education","management-analytics",
          "finance","accounting","economics","pharmacology"]
for kw in keywords:
    # 找 ut- 开头的 id 或 en 含关键词
    hits=re.findall(r'\{id:"(ut-[^"]+)"[^}]*?en:"([^"]+)"[^}]*?\}', seg)
    found=[(i,e) for i,e in hits if kw.lower() in (i+" "+e).lower()]
    if found:
        print(f"[{kw}] 已在 PROGRAMS:")
        for i,e in found: print("   ",i,"|",e)
    else:
        print(f"[{kw}] 不在 PROGRAMS")
