knowledge(M01): 본문 대조 오탐 둘 정리 — 1-2-4 미올림 뒷항 제외 · 칸 안 줄바뀜 수 이어 읽기
- CC000337 결손 18 = 1-2-4 5·6항 표 미올림 · CC000074 결손 51 = 원문 규격 5,150 줄바뀜 · 본문 대조 0건 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JgUhN55Z3BCYhUJTjwTNfj
This commit is contained in:
@@ -484,6 +484,8 @@ def _canon(token: str) -> str:
|
||||
|
||||
|
||||
def numbers_in(text: str) -> set[str]:
|
||||
# 칸 안에서 줄바뀐 천 단위 수(「5,1<br>50」)는 이어 붙임
|
||||
text = re.sub(r"(?<=\d,\d)<br>(?=\d{2})", "", text)
|
||||
return {_canon(t) for _, line in md_lines(text) for t in _NUM.findall(line)}
|
||||
|
||||
|
||||
@@ -499,6 +501,10 @@ def _flat(value) -> set[str]:
|
||||
return set()
|
||||
|
||||
|
||||
# 절 안에서 아직 표로 안 올린 뒷항의 머리 — 그 앞까지만 결손 대조(1-2-4 5항 발생재 공제율 · 6항 강관배관 부자재율)
|
||||
UNBUILT = {"1-2-4": "5\\. 발생재의 처리"}
|
||||
|
||||
|
||||
def check_body(files: dict[str, dict]) -> list[str]:
|
||||
"""표마다 허구 · 절마다 결손."""
|
||||
out, by_section = [], {}
|
||||
@@ -530,6 +536,9 @@ def check_body(files: dict[str, dict]) -> list[str]:
|
||||
if md2 == md and ident2.startswith(ident + "-"):
|
||||
mine = mine | mine2
|
||||
tables = tables + tables2
|
||||
cut = UNBUILT.get(ident)
|
||||
if cut and cut in text:
|
||||
text = text[: text.index(cut)] # 표로 안 올린 뒷항은 결손 대조에서 뺌
|
||||
table_text = "\n".join(line for line in text.split("\n") if line.lstrip().startswith("|"))
|
||||
lack = numbers_in(table_text) - mine
|
||||
if lack:
|
||||
|
||||
Reference in New Issue
Block a user