fix(m02-df): 표 범위 칸에 숫자 하나(아래 = 위)면 「같음」 — 브레인 정함

- 아래 ≠ 위는 지금대로(아래 < 값 ≤ 위 · 빈 끝 열림) · 견치돌 「높이 4」 같은 줄이 맞음
- 시험 — 저장 다시 셈 4 → 0.7 줄 · apply_rule 4 / 3.5 / 3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmELpdXFDRZHhfbGuRhSmL
This commit is contained in:
2026-10-01 20:01:27 +09:00
co-authored by Claude Opus 5.5
parent 868dc8e37f
commit 39c0d163ff
2 changed files with 21 additions and 1 deletions
@@ -314,7 +314,7 @@ def _rounded(value: Any, r: dict) -> Any:
def _lookup(rule: dict, block: Any, conds: dict) -> tuple[Any, str | None]:
"""표에서 찾기 — 같음 · 범위(「이름·아래」 < 값 ≤ 「이름·위」 · 빈 끝 열림) · 맞은 줄 하나만."""
"""표에서 찾기 — 같음 · 범위(아래 < 값 ≤ 위 · 빈 끝 열림 · 아래 = 위면 같음) · 맞은 줄 하나."""
if not isinstance(block, list) or len(block) < 2:
return None, "오류"
head = [str(h if h is not None else "") for h in block[0]]
@@ -336,6 +336,8 @@ def _lookup(rule: dict, block: Any, conds: dict) -> tuple[Any, str | None]:
def fits(row, lo=lo, hi=hi, x=x) -> bool:
low, high = _num_of(row[lo]), _num_of(row[hi])
if low is not None and low == high: # 숫자 하나(아래 = 위) = 같음(브레인 정함)
return x is not None and x == low
return (
x is not None
and (row[lo] is None or (low is not None and low < x))