diff --git a/B08_Quantity/B08_Quantity_Engine_Handoff_Mapping.py b/B08_Quantity/B08_Quantity_Engine_Handoff_Mapping.py index 7bdc944e..19f2c66c 100644 --- a/B08_Quantity/B08_Quantity_Engine_Handoff_Mapping.py +++ b/B08_Quantity/B08_Quantity_Engine_Handoff_Mapping.py @@ -148,6 +148,26 @@ def _latest_dataset_path(directory: Path | None = None) -> Path | None: return files[-1] if files else None +#: ⚠ **공종 수량 단위가 아닌 것** — 품셈 절 머리에 섞여 있는 모양들이다(2026-09-08 B09 전수). +#: `(㎥/1대, 1일)` 는 **시공량**이라 「1대가 하루에 몇 ㎥」이고, 밑수(「1㎥ 에 얼마」)의 +#: **역수**다. 그대로 밑수로 받으면 그 공종이 조용히 뒤집힌 단위를 갖는다. +#: `(일당)`·`(조)`·`(인)` 은 **품의 단위**이지 공종 단위가 아니다. +NON_QUANTITY_UNITS = frozenset({"일당", "조", "인", "일", "대", "인당"}) + + +def is_quantity_unit(unit: str) -> bool: + """그 글자가 **공종 수량의 밑수 단위**로 쓸 수 있는가. + + ⚠ **좁게 본다** — 애매하면 안 받는다. 안 받으면 대조가 없을 뿐이고, 잘못 받으면 + **틀린 단위로 검사를 통과시킨다**(그쪽이 더 나쁘다). + """ + text = str(unit or "").strip() + if not text or text in NON_QUANTITY_UNITS: + return False + # 「㎥/1대, 1일」처럼 나눗셈·쉼표가 있으면 시공량이거나 밑수가 둘이다. + return "/" not in text and "," not in text + + @dataclass class WorkItemMapping: """수량 줄 → 공종 마스터 코드. 못 찾으면 `None` 을 돌려주고 부른 쪽이 목록에 남긴다.""" @@ -173,7 +193,7 @@ class WorkItemMapping: found: dict[str, str] = {} for row in (*self.earthwork, *self.haul, *self.structure): code, unit = row.get("work_item_code"), row.get("basis_unit") - if code and unit: + if code and unit and is_quantity_unit(str(unit)): found[str(code)] = str(unit) return found diff --git a/resources/data_work_item_mapping/work_item_mapping_2026-01-01.json b/resources/data_work_item_mapping/work_item_mapping_2026-01-01.json index bba043fc..61f3a127 100644 --- a/resources/data_work_item_mapping/work_item_mapping_2026-01-01.json +++ b/resources/data_work_item_mapping/work_item_mapping_2026-01-01.json @@ -101,7 +101,9 @@ { "group": "초류종자살포", "work_item_code": "FP-05-24", - "master_name": "씨앗뿜어붙이기" + "master_name": "씨앗뿜어붙이기", + "basis_unit": "㎡", + "basis_source": "산림사업 표준품셈(고시 2025-82) 원문 L2769·L2794 — 5-24-1·5-24-2 절 머리 바로 아래 「(㎡당)」. ⚠ 「단위:」 글자 없이 **괄호만** 적힌 모양이라 마스터가 못 읽은 자리(2026-09-08 원문 대조)." }, { "group": "되메우기",