Case_02_Comparison_Research - Stage 1 v.8: Part 1~4 YAMLs with R1~R3 patches, F-1/F-2 fixes, 피고과식별방지 prompt (defendant_qualification), dated backups, 실행검사/실패분석 reports - Stage 2 S2_00: v7.4 handoff (Task_S2_00_handoff, 경량화 전략서 + §2 개정) and v7.5 defendant qualification gate (피고관련작업_개정_S2_00.md), copies v.7/v.10/v.11, dated backups, 실행보고서/실패분석/결과물 리스트 - Stage 2 S2_10: v6/v7/v8 failure analyses, 재작성전략 10_06/10_08, case_kind_registry.json, 연구조사보고서_S2_10_재작성용.md (v.1), _추가.md (multi-claim methodology) and merged _v.2.md (claims[] 1~4, join PRELIMINARY/SELECTIVE/INDEPENDENT, V1~V6), S2_10_Test run outputs, 실행검사 v.10/v.11 - Stage_2 MEMORY.md / CLAUDE.md / work-history notes, AGENTS.md and README_KO.md updates Other corpora and tooling - Default_Agent_청구취지기재방법: 청구취지 규칙문서 전체 모음(원문·사건종류별·raw) and tmp drafts - 요건사실론: 사건종류별 문서(raw·filtered), plans, rf_draft - 판례모음, STT_앱구성_연구, API Crowdness 조사, update_numbers.py Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
68 lines
2.5 KiB
Python
68 lines
2.5 KiB
Python
import json
|
|
from numbers_parser import Document
|
|
import sys
|
|
|
|
def main():
|
|
json_path = "/Users/hogyujhang/Library/CloudStorage/Dropbox/Business/Eroom AI Partners/Legal POC portfolio/민사에이전트-사해행위취소및대여금청구/POC - Law-aid Agent/프롬프트/prompt_updates_sequential/Default_Agent_청구취지기재방법/case_kind_registry.json"
|
|
numbers_path = "/Users/hogyujhang/Library/CloudStorage/Dropbox/Business/Eroom AI Partners/Legal POC portfolio/민사에이전트-사해행위취소및대여금청구/POC - Law-aid Agent/프롬프트/prompt_updates_sequential/판례모음/판례수집_진행상황.numbers"
|
|
|
|
# 1. Load JSON
|
|
with open(json_path, 'r', encoding='utf-8') as f:
|
|
data = json.load(f)
|
|
|
|
case_kinds = [item.get("사건 종류") for item in data if item.get("사건 종류")]
|
|
|
|
if not case_kinds:
|
|
print("No '사건 종류' found in JSON.")
|
|
return
|
|
|
|
print(f"Loaded {len(case_kinds)} items from JSON.")
|
|
|
|
# 2. Open Numbers Document
|
|
doc = Document(numbers_path)
|
|
sheets = doc.sheets
|
|
if not sheets:
|
|
print("No sheets found in numbers file.")
|
|
return
|
|
|
|
sheet = sheets[0] # assuming first sheet
|
|
tables = sheet.tables
|
|
if not tables:
|
|
print("No tables found in the first sheet.")
|
|
return
|
|
|
|
table = tables[0] # assuming first table
|
|
|
|
# 3. Find column header '사건종류'
|
|
target_col = -1
|
|
target_row = -1
|
|
for r, row in enumerate(table.iter_rows()):
|
|
for c, cell in enumerate(row):
|
|
if cell and hasattr(cell, 'value') and cell.value and '사건종류' in str(cell.value).replace(' ', ''):
|
|
target_col = c
|
|
target_row = r
|
|
break
|
|
if target_col != -1:
|
|
break
|
|
|
|
if target_col == -1:
|
|
print("Could not find column header '사건종류'.")
|
|
return
|
|
|
|
print(f"Found '사건종류' at row {target_row}, col {target_col}.")
|
|
|
|
# 4. Write data to the cells below the header
|
|
for i, case_kind in enumerate(case_kinds):
|
|
# We write to target_row + 1 + i
|
|
# numbers-parser will expand the table if needed
|
|
table.write(target_row + 1 + i, target_col, case_kind)
|
|
|
|
print(f"Wrote {len(case_kinds)} rows.")
|
|
|
|
# 5. Save document
|
|
doc.save(numbers_path)
|
|
print("Saved successfully.")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|