Files
Liti-agent-Development/요건사실론/tmp/rf_draft/leaf_id.py
T
jhogyuandClaude Fable 5.1 5f9853e44b chore: snapshot of work since 2026-10-05 (Stage 1 v.8, S2_00 v7.4/v7.5 handoff, S2_10 rewrite research v.2, 청구취지·요건사실 corpora)
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>
2026-10-12 13:02:13 +09:00

37 lines
1.9 KiB
Python

# 실행: python3 tmp/rf_draft/leaf_id.py "<####>"
import sys, re, unicodedata as u
CHO=['g','kk','n','d','tt','r','m','b','pp','s','ss','','j','jj','ch','k','t','p','h']
JUNG=['a','ae','ya','yae','eo','e','yeo','ye','o','wa','wae','oe','yo','u','wo','we','wi','yu','eu','ui','i']
JONG=['','k','k','k','n','n','n','t','l','k','m','l','l','l','p','l','m','p','p','t','t','ng','t','t','k','t','p','t']
def rom(s):
o=[]
for c in u.normalize('NFC', s):
n=ord(c)
if 0xAC00<=n<=0xD7A3:
i=n-0xAC00; o.append(CHO[i//588]+JUNG[(i%588)//28]+JONG[i%28])
elif c.isascii() and c.isalnum(): o.append(c.lower())
else: o.append('-')
return re.sub(r'-+','-',''.join(o)).strip('-')
def norm(s):
s=u.normalize('NFC', s)
return ''.join(ch for ch in s if ch not in ' \t・·•,()')
SKIP={'가사소송','가족관계등록','행정소송'}
leaves=[]
for ln in open('case_kinds.md', encoding='utf-8'):
ln=u.normalize('NFC', ln).strip()
if not ln.startswith('|'): continue
cells=[c.strip() for c in ln.strip('|').split('|')]
if len(cells)<3 or cells[0]=='소송 대분류' or set(cells[0])<=set('- '): continue
big, dis, kinds = cells[0], cells[1], cells[2]
if big in SKIP: continue
leaves += [dis] if not kinds else [p.strip() for p in kinds.split(',') if p.strip()]
assert len(leaves)==137, f'leaf 총수 {len(leaves)} != 137 — 중단'
for n, nm in ((1,'대여금 청구'),(60,'종류물(대체물)의 지급 또는 인도를 구하는 소'),
(66,'매매를 원인으로 한 소유권이전등기 청구'),(128,'기타 확인청구'),
(137,'주주총회결의취소의 소')):
assert norm(leaves[n-1])==norm(nm), f'검산 실패 PROV-{n:03d}: {leaves[n-1]}'
q=norm(sys.argv[1]); hit=[(i,x) for i,x in enumerate(leaves,1) if norm(x)==q]
assert len(hit)==1, f'사건종류 매칭 {len(hit)}건 — 중단'
i, name = hit[0]
print(f'PROV-{i:03d}', name, rom(name), sep='\t')