Repository navigation
test: 테스트 추가 및 섹션 헤더 선택 버그 수정 - #35
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
테스트를 추가하고, 그 과정에서 드러난 섹션 헤더 선택 버그를 수정
변경 내용
1. 제출 명세 대응 테스트 추가 (0e4967b)
tests/specification/— pytest 51개 함수(매개변수 포함 78 케이스)tests/는 그대로 유지2. 이전 페이지 섹션 제목 선택 수정 (83aa945)
현상 — 표의 섹션 제목을 이전 페이지에서 찾을 때 그 페이지의 맨 위 제목을 반환했다.
원인 —
context.py::find_section_header가(page_no, -cy)로 정렬한 뒤 마지막 원소를 선택한다. TOPLEFT 좌표에서는 cy가 클수록 페이지 아래쪽이므로,-cy오름차순의 마지막 원소는 해당 페이지의 최상단 제목이 된다. 코드 주석도 반대로 서술돼 있었다.수정 — 정렬 키를
(page_no, cy)오름차순으로 바꿔 마지막 원소가 (최대 page_no, 최대 cy) = 표 바로 앞에 나온 마지막 제목이 되게 했다. 주석도 정정.회귀 테스트 —
tests/test_context_section_header.py7건 추가(이전 페이지 하단 제목 선택, 이전 페이지 다중 시 최근접 우선, 같은 페이지 우선순위, 같은 페이지에서 표 아래 제목 무시, 제목 없음, page_no=-1 무시)
검증
환경: Windows 11 / Python 3.14.5, docling 미설치 경량 구성
(
pytest beautifulsoup4 tiktoken langchain-core llama-index-core+--no-deps -e .)test_qa23_previous_page_last_header_is_selectedPASS로 전환. 다른 테스트 회귀 없음.남은 실패 (별도 이슈)
test_qa15_caption_must_be_in_first_row— 병합 셀 캡션 탐색이 첫 행을 벗어남 (병합 셀 캡션 탐색이 표 첫 행을 벗어남 #34 )test_qa34_final_text_respects_512_token_limit— 분할 조각이 토큰 한도 초과 (분할 조각의 최종 텍스트가 512토큰 한도를 초과 #33 )test_qa35_full_footnote_text_only_in_last_chunk— 각주 위치 해석 A안 확정에 따라 테스트 정정 예정Fixes #32