Skip to content

v0.11.0

Latest

Choose a tag to compare

@tomnio tomnio released this 21 Sep 08:02
· 3 commits to main since this release
v0.11.0
e31a5ab

Added

  • joinPages() (@tomnio/rubric/pdf): joins per-page text from extractPdfPages() into one document string while recording each page's span in it. The spans share the coordinate space of the chunk offsets createDocument() reports, so any merged value can be traced back to the page it came from:

    import { extractPdfPages, joinPages } from "@tomnio/rubric/pdf"
    
    const { pages } = await extractPdfPages(pdfBytes)
    const { text, spans } = joinPages(pages)
    const { chunks } = await createDocument(client, { document: text, ... })
    const pageOf = (offset: number) =>
      spans.find((s) => offset >= s.startOffset && offset < s.endOffset)?.number

Housekeeping

  • CI: actions/checkout and actions/setup-node bumped to v5.