feat(801-5): M01 로직 단위 글 건설품셈 원문 꼴 — 시간당 ㎥ · ㎡ → hr · 초 → sec · mm · cm · kg → ㎜ · ㎝ · ㎏ · TON · t → ton · km/hr → ㎞/hr
- 대응표 master_unit_text.RULES(규칙마다 원문 근거 절) · 빌더 build_단위표기_801_5(--check · --list · 셈 지문 전후 같을 때만 씀) - M01 로직 53 개 · 칸 79 개 글만 바꿈(변수 입력 · 중간 단위 · 결과단위) · 계수 · 소요량 표 값칸 · 호표 줄 단위 · 원문이 두 꼴을 다 쓰는 단위(㎞ · km · 분 · min)는 안 건드림 - M02 사본 새로 씀 도구 M02_Copy_Units(M02_Copy_Symbols 의 fill 만 바꿔 끼움) — 사본 16 문서 28 칸 · 금액 전후 같음 - 검토 목록 docs/raw/요구_1104/_목록_801-5_단위표기.xlsx - 옛 시험 기대 고침: test_796_3 굴착기 cm 단위 초 → sec(원문 표 머리 「싸이클시간(Sec)」) - 새 test_801_5_units 6 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,8 +59,8 @@ def fill(copy: dict, whole: Any) -> tuple[dict, int, int]:
|
||||
return {**copy, "로직": rows, "판": skc._fp(rows)}, done, lost
|
||||
|
||||
|
||||
def check(kind: str, path: Path) -> dict[str, Any]:
|
||||
"""문서 하나 — {상태: 있음 | 채울것없음 | 같음 | 다름 | 못셈, 채움, 못닿음, 사본?}."""
|
||||
def check(kind: str, path: Path, fill_fn=None) -> dict[str, Any]:
|
||||
"""문서 하나 — {상태: 있음 | 채울것없음 | 같음 | 다름 | 못셈, 채움, 못닿음, 사본?} · `fill_fn` = 다른 고침(801-5 단위 글)."""
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Store as store
|
||||
|
||||
doc = json.loads(path.read_bytes())
|
||||
@@ -69,7 +69,7 @@ def check(kind: str, path: Path) -> dict[str, Any]:
|
||||
try:
|
||||
with store.at(path.parent.parent):
|
||||
live = skc.whole_()
|
||||
new, done, lost = fill(doc[skc.KEY], live)
|
||||
new, done, lost = (fill_fn or fill)(doc[skc.KEY], live)
|
||||
if not done:
|
||||
return {"상태": "채울것없음", "못닿음": lost}
|
||||
clean = mig._clean(kind, doc, path.stem)
|
||||
@@ -81,7 +81,7 @@ def check(kind: str, path: Path) -> dict[str, Any]:
|
||||
return {**row, "사본": new} if before == after else {**row, "전": before, "후": after}
|
||||
|
||||
|
||||
def run(apply: bool = False, backup: Path | None = None) -> list[dict[str, Any]]:
|
||||
def run(apply: bool = False, backup: Path | None = None, fill_fn=None) -> list[dict[str, Any]]:
|
||||
"""마스터 · 회사 · 개인 층 문서마다 {어디, 종류, 키, 상태, 씀, …} · `apply` = 같음만 씀."""
|
||||
if apply and backup is None:
|
||||
raise ValueError("--apply 는 --backup 폴더가 있어야 함")
|
||||
@@ -89,7 +89,7 @@ def run(apply: bool = False, backup: Path | None = None) -> list[dict[str, Any]]
|
||||
for where_, kind, path, project in mig._files():
|
||||
if project:
|
||||
continue
|
||||
got = check(kind, path)
|
||||
got = check(kind, path, fill_fn)
|
||||
copy = got.pop("사본", None)
|
||||
row = {"어디": where_, "종류": kind, "키": path.stem, **got, "씀": False}
|
||||
if apply and copy:
|
||||
|
||||
Reference in New Issue
Block a user