MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / build_pages

Function build_pages

scripts/extract_source_text.py:192–207  ·  view source on GitHub ↗
(
    page_texts: list[dict[str, Any]],
    sections: list[dict[str, Any]],
)

Source from the content-addressed store, hash-verified

190
191
192def build_pages(
193 page_texts: list[dict[str, Any]],
194 sections: list[dict[str, Any]],
195) -> list[dict[str, Any]]:
196 pages: list[dict[str, Any]] = []
197 for page in page_texts:
198 page_number = int(page["page"])
199 text = str(page.get("text", ""))
200 pages.append(
201 {
202 "page": page_number,
203 "char_count": len(normalize_whitespace(text)),
204 "section_ids": section_ids_for_page(sections, page_number),
205 }
206 )
207 return pages
208
209
210def primary_section_for_page(sections: list[dict[str, Any]], page_number: int) -> str:

Callers 1

build_manifestFunction · 0.85

Calls 2

normalize_whitespaceFunction · 0.90
section_ids_for_pageFunction · 0.85

Tested by

no test coverage detected