diff --git a/B09_Estimation/B09_Estimation_MachineProductivity_Reference.py b/B09_Estimation/B09_Estimation_MachineProductivity_Reference.py index 91442755..311bb893 100644 --- a/B09_Estimation/B09_Estimation_MachineProductivity_Reference.py +++ b/B09_Estimation/B09_Estimation_MachineProductivity_Reference.py @@ -17,7 +17,8 @@ ⚠ **못 따라가는 참조는 따라간 척하지 않는다.** · **자기 자신을 가리키는 것** — 9-13-14 가 「육상 발파암(1~2m)와 동일」이라 적었는데 - 그 절이 곧 육상 발파암(1~2m)이다(원문 오기로 보이나 **고쳐 읽지 않는다**). + 그 절이 곧 육상 발파암(1~2m)이다. ⭐ 2026-09-14 브레인 승인으로 **그 두 절만** 고쳐 읽음 + (`READ_AS` — 고른 값·버린 값을 근거 줄에 나란히). 나머지 자기 참조는 여전히 빈 채로. · **가리키는 절을 못 찾는 것 · 그 절도 계수가 없는 것.** 이 셋은 사유를 남기고 **빈 채로 둔다.** """ @@ -35,6 +36,21 @@ _NAMED = re.compile(r"^(?P.+?)\s*(?:와|과)\s*동일$") #: 「육상과동일」 — 이름이 아니라 **한 낱말만 바꾸라**는 지시다(용수 → 육상). _SWAP_WORDS = (("용수", "육상"),) +#: 원문 참조가 풀 수 없게 적힌 자리를 **사람이 판정해** 고쳐 읽음 — 공종 → (읽을 이름, 사유). +#: ⚠ 넓히지 말 것. 판정마다 근거(같은 절 형제들의 표기)를 사유에 적고 브레인·사용자 승인을 받음. +READ_AS: dict[str, tuple[str, str]] = { + "FP-09-13-14": ( + "육상 발파암(0~1m)", + "원문 표기 「육상 발파암(1~2m)와 동일」(고시 2025-82 5189줄)은 자기 참조라 풀 수 없어" + " 0~1m(9-13-13)로 읽음 — 같은 절 암절취(1~2m·2~3m)·용수 발파암이 모두 「(0~1m)와 동일」", + ), + "FP-09-13-15": ( + "육상 발파암(0~1m)", + "원문 표기 「육상 발파암(1~2m)와 동일」(고시 2025-82 5201줄)이 가리키는 9-13-14 가 자기" + " 참조라 끝이 없어 0~1m(9-13-13)로 읽음 — 같은 절 형제들이 모두 「(0~1m)와 동일」", + ), +} + #: 이 이름들만 계수로 본다. 참조가 가리키는 것도 결국 이 넷이다. _FACTOR_HEADS = { "k": "K", @@ -156,6 +172,9 @@ def reference_factor_values( if found is None: return own, [], "" target_name, raw_text = found + read_as = READ_AS.get(code) + if read_as: + target_name = read_as[0] matches = [m for m in by_name.get(_normalize_name(target_name), []) if m != code] if not matches: return own, [], f"「{raw_text}」가 가리키는 절을 못 찾았습니다" @@ -172,6 +191,8 @@ def reference_factor_values( if missing: return own, [], f"「{raw_text}」를 따라갔으나 계수가 없습니다 — {', '.join(missing)}" step = f"「{raw_text}」 → {nodes[target].get('name', target)}" + if read_as: + step += f" ⚠ {read_as[1]}" return merged, [step, *path], "" for code, node in nodes.items(): diff --git a/resources/tester/test_b09_table_reading_2.py b/resources/tester/test_b09_table_reading_2.py index 391d1a1f..d6fa7a81 100644 --- a/resources/tester/test_b09_table_reading_2.py +++ b/resources/tester/test_b09_table_reading_2.py @@ -27,3 +27,16 @@ def test_표면_마무리엔_미장공_표만_있고_가짜_갈래가_없음() - build = cached_build() assert [c for c in build.book.titles if c.startswith("B-FP-12-02")] == ["B-FP-12-02"] assert not build.unattached.get("FP-12-02") + + +def test_육상_발파암_1_3m_들어내기는_0_1m_로_읽고_고른_값_버린_값을_사유에() -> None: + """③ 원문 「육상 발파암(1~2m)와 동일」(고시 5189·5201줄)은 9-13-14 자기 참조 — 같은 절 암절취· + 용수 발파암이 모두 「(0~1m)와 동일」 이라 0~1m(9-13-13)로 읽음(2026-09-14 브레인 승인).""" + build = cached_build() + for code in ("FP-09-13-14", "FP-09-13-15"): + assert code not in build.partial_ratio and code not in build.component_gaps, code + # 들어내기 참조 줄은 풀림 — 남는 것은 치즐뿐(기본 조립엔 치즐 단가가 없어 종전대로) + left = [label for label in build.unattached.get(code, []) if "치즐" not in label] + assert not left, left + source = build.factor_sources.get(code, "") + assert "육상 발파암(0~1m)" in source and "자기 참조" in source, source