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>
37 lines
1.5 KiB
Python
37 lines
1.5 KiB
Python
import re,sys,html
|
|
def load(p):
|
|
return open(p,encoding='utf-8').read()
|
|
def strip(s):
|
|
s=re.sub(r'<!\[CDATA\[(.*?)\]\]>',r'\1',s,flags=re.S)
|
|
s=re.sub(r'<[^>]+>','',s)
|
|
return html.unescape(s)
|
|
def arts(path):
|
|
t=load(path)
|
|
out={}
|
|
for m in re.finditer(r'<조문단위[^>]*>(.*?)</조문단위>',t,re.S):
|
|
blk=m.group(1)
|
|
no=re.search(r'<조문번호>(.*?)</조문번호>',blk)
|
|
ga=re.search(r'<조문가지번호>(.*?)</조문가지번호>',blk)
|
|
key=no.group(1) if no else '?'
|
|
if ga and ga.group(1).strip(): key+='-'+ga.group(1)
|
|
sd=re.search(r'<조문시행일자>(.*?)</조문시행일자>',blk)
|
|
out[key]=(strip(blk).strip(), sd.group(1) if sd else '')
|
|
bi=re.search(r'<기본정보>(.*?)</기본정보>',t,re.S)
|
|
info=''
|
|
if bi:
|
|
nm=re.search(r'<법령명_한글>(.*?)</법령명_한글>',bi.group(1))
|
|
ef=re.search(r'<시행일자>(.*?)</시행일자>',bi.group(1))
|
|
pn=re.search(r'<공포번호>(.*?)</공포번호>',bi.group(1))
|
|
info=f"{strip(nm.group(1)) if nm else ''} | 시행 {ef.group(1) if ef else ''} | 공포번호 {pn.group(1) if pn else ''}"
|
|
return info,out
|
|
which=sys.argv[1]; want=sys.argv[2].split(',')
|
|
info,a=arts(which)
|
|
print("### ",info)
|
|
for w in want:
|
|
if w in a:
|
|
body,sd=a[w]
|
|
print(f"\n--- 제{w}조 (조문시행일 {sd}) ---")
|
|
print(re.sub(r'\n{2,}','\n',body)[:2600])
|
|
else:
|
|
print(f"\n--- 제{w}조 : 없음 ---")
|