import os, sys sys.path.append('scratch') from find_strict_grouped_tables import true_grouped_tables sys.stdout.reconfigure(encoding='utf-8') plant_tables = [t for t in true_grouped_tables if t['file'] == '제13장_플랜트설비공사.md'] fpath = 'resources/knowledge/original/원가계산/건설공사_표준품셈/04_기계설비부문/제13장_플랜트설비공사.md' with open(fpath, 'r', encoding='utf-8') as f: lines = f.readlines() print(f"Total plant grouped tables: {len(plant_tables)}") # Filter for tables with process / work categories (like 공정별 설치, 작업구분, etc.) process_tables = [] for t in plant_tables: # check title or groups title = t['title'] groups = t['groups'] if any(k in title for k in ['공정별', '작업구분', '공정', '설치', '조립', '소각', '보일러', '터빈', '발전기', '수차']) or \ any(any(w in g for w in ['조립', '설치', '해체', '관리', '검사', 'Chipping', '손질']) for g in groups): process_tables.append(t) print(f"Process / Work classification tables in Plant: {len(process_tables)}") for pt in process_tables: print(f"\n=======================================================") print(f"L{pt['line']}: {pt['title']}") print(f"Groups: {pt['groups'][:5]}") start = max(0, pt['line'] - 1) end = min(len(lines), pt['line'] + pt['total_rows'] + 2) for i in range(start, min(end, start + 25)): print(f"{i+1:4d}: {lines[i].rstrip()}")