File size: 761 Bytes
e6ea8c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

from app import analyze
import traceback

def test_analyze():
    pdf_path = "test_document.pdf"
    page_num = 1
    dpi = 72
    order_mode = "raw"
    show_spans = False
    highlight_math = False
    
    try:
        print(f"Analyzing {pdf_path}...")
        overlay, report, summary, preview = analyze(
            pdf_path, page_num, dpi, order_mode, show_spans, highlight_math
        )
        print("Analysis successful!")
        print(f"Summary length: {len(summary)}")
        print(f"Preview length: {len(preview)}")
        print(f"Report keys: {report.keys()}")
        print(f"Overlay size: {overlay.size}")
    except Exception as e:
        print(f"CRASHED: {e}")
        traceback.print_exc()

if __name__ == "__main__":
    test_analyze()