79132784

Date: 2024-10-28 09:35:40
Score: 1.5
Natty:
Report link

You can split the markdown content using the properties from result.pages.

di_result_md_pages = {}

for page in result.pages:
    start = page.spans[0]['offset']
    end = page.spans[0]['offset'] + page.spans[0]['length']
    
    content = result.content[start:end]
    di_result_md_pages[page.page_number] = content

This will result in a dictionary with the original page number as key and the markdown content as value.

Originally found here: https://stackoverflow.com/a/78750151

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Xinho