fix(axis): 9-19-3 비탈면 고르기(발파암) 소형브레이커 = 5210-0010(1.0㎥/min) — 값 출처 9-19-1 표·[주]① 이 규격을 정함(브레인 승인) · 범위 별칭이 코드를 적으면 그 항목으로 곧장 이음 · 어어호스는 카탈로그 없어 그대로
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
This commit is contained in:
@@ -574,8 +574,10 @@ def match_table(
|
||||
# 정상 자원이 조용히 사라진다(2026-09-07 실측 — 부분일치 필터가 매칭 14건을
|
||||
# 지우고 있었음). 카탈로그에 있는 이름은 **정의상 자원**이다.
|
||||
# 범위 별칭 — 그 공종 범위 안에서만 카탈로그 쪽 이름으로 바꾼다(「화약공」 → 화약취급공).
|
||||
# 별칭이 코드를 적었으면 그 항목으로 곧장(규격이 조인 키인 기계가 다시 흐려지지 않게).
|
||||
entry = scoped_alias_entry(catalog, name_cell, node["work_item_code"])
|
||||
name_cell = apply_scoped_alias(catalog, name_cell, node["work_item_code"])
|
||||
entry = _resolve_cell(catalog, name_cell, [name_cell, *value_cells])
|
||||
entry = entry or _resolve_cell(catalog, name_cell, [name_cell, *value_cells])
|
||||
if entry is None:
|
||||
if is_non_resource_label(name_cell):
|
||||
continue # 머리글·소계 — 못 맞춘 목록에도 안 올린다
|
||||
@@ -699,6 +701,7 @@ from B09_Estimation.B09_Estimation_ResourceAxis_Sources import ( # noqa: E402
|
||||
from B09_Estimation.B09_Estimation_ResourceAxis_Join import ( # noqa: E402
|
||||
apply_scoped_alias,
|
||||
pick_by_spec,
|
||||
scoped_alias_entry,
|
||||
resolve_family,
|
||||
text_spec_candidates,
|
||||
unmatched_reason,
|
||||
|
||||
@@ -107,6 +107,22 @@ def load_scoped_aliases() -> list[dict[str, str]]:
|
||||
return load_aliases("resource")
|
||||
|
||||
|
||||
def scoped_alias_entry(
|
||||
catalog: ResourceCatalog, name_cell: str, work_item_code: str
|
||||
) -> CatalogEntry | None:
|
||||
"""범위 별칭이 가리키는 **항목 그 자체**(코드로 곧장) — 없으면 `None`.
|
||||
|
||||
⚠ 이름만 돌려주면 규격이 조인 키인 기계(소형브레이커 공압식 넷)는 다시 「규격 미정」 으로
|
||||
흐려짐 — 별칭이 코드를 적었으면 그 코드가 곧 답(2026-09-14 · 9-19-3 소형브레이커).
|
||||
"""
|
||||
wanted = _normalize(name_cell)
|
||||
for row in catalog.scoped_aliases:
|
||||
if _normalize(row["from"]) != wanted or not in_scope(work_item_code, row["scope"]):
|
||||
continue
|
||||
return next((entry for entry in catalog.entries if entry.code == row["to"]), None)
|
||||
return None
|
||||
|
||||
|
||||
def apply_scoped_alias(catalog: ResourceCatalog, name_cell: str, work_item_code: str) -> str:
|
||||
"""범위 안이면 카탈로그 쪽 **이름**으로 바꾼다. 범위 밖이거나 대상 코드가 없으면 원문 그대로."""
|
||||
wanted = _normalize(name_cell)
|
||||
|
||||
Reference in New Issue
Block a user