feat(reader): PDF form-feed를 --- Page N --- 마커로 변환#31
Merged
Conversation
pdftotext와 pdf_extract 양 경로에서 \f(form-feed)를 --- Page N --- 마커로 치환하는 inject_page_markers() 추가. - 첫 페이지는 마커 없이 유지 (N은 1-based) - PPTX의 --- Slide N --- 패턴과 일관성 유지 - FileReader trait 시그니처 변경 없음 - SCHEMA_VERSION 변경 없음 → 기존 인덱스 리빌드 불필요 - Evidence Retrieval 파이프라인에서 snippet으로 페이지 번호 확인 가능
- collect::<Vec<_>>().join("") → iter::once + chain + collect::<String>()으로 중간 힙 할당 제거
- i == 0 분기 제거: first 페이지를 split.next()로 분리하고 나머지를 enumerate(i+2)로 처리
- 테스트 3개 추가: 빈 문자열, 앞쪽 form-feed, 끝쪽 form-feed edge case 커버
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.
Summary
PDF 텍스트 추출 시 form-feed(
\f) 문자를--- Page N ---마커로 치환합니다.Motivation
Evidence Retrieval 파이프라인에서 검색 결과 snippet의 페이지 번호가 필요합니다. PPTX가 이미
--- Slide N ---패턴을 사용하는 것과 동일한 방식으로 PDF에 적용합니다.Changes
src/index/reader.rsinject_page_markers()헬퍼 추가,pdf_extract및pdftotext양 경로에 적용src/index/mod.rsNon-Impact
FileReadertrait 시그니처 변경 없음Test Results
Audit