A fast, helpful, and open-source document parser
nits
Logan Markewichda3d377deff7
diff --git a/crates/liteparse/src/font_db_resolver.rs b/crates/liteparse/src/font_db_resolver.rsindex b5d6a44..a5c1184 100644--- a/crates/liteparse/src/font_db_resolver.rs+++ b/crates/liteparse/src/font_db_resolver.rs@@ -1,5 +1,5 @@//! Built-in [`GlyphResolver`] backed by a fragmented glyph-outline → unicode-//! database (the LlamaParse "font-forge" map).+//! database / map.//!//! The database is a directory of `%02x%02x.msgpack` shards. Each shard is a//! stream of concatenated 2-element msgpack arrays `[hash, unicode]`:@@ -9,8 +9,7 @@//!//! To resolve a glyph we hash its outline segments exactly as the producer did//! — little-endian `{i32 segment_type, f32 x, f32 y}` per segment, BLAKE3,-//! truncated to 16 bytes — load the matching shard, and look the key up. This-//! mirrors the C consumer in `llamaparse/pdfium/parse/src/core/font.c`.+//! truncated to 16 bytes — load the matching shard, and look the key up.//!//! Not compiled for `wasm32` (no filesystem). Construct directly, or let//! [`crate::LiteParse::new`] auto-wire one when `LITEPARSE_FONT_DB_DIR` is set.diff --git a/crates/liteparse/src/ocr/http_simple.rs b/crates/liteparse/src/ocr/http_simple.rsindex 8ace82f..9a9e4f0 100644--- a/crates/liteparse/src/ocr/http_simple.rs+++ b/crates/liteparse/src/ocr/http_simple.rs@@ -32,7 +32,7 @@ impl HttpOcrResponseItem {}}-/// A single detection from the LlamaParse prod OCR worker, which emits+/// A single detection from an OCR worker, which emits/// EasyOCR/PaddleOCR-style positional tuples: `[polygon, text, confidence]`,/// where `polygon` is a list of `[x, y]` points (4 for both engines) ordered/// top-left → top-right → bottom-right → bottom-left.@@ -68,7 +68,7 @@ impl ProdOcrItem {}}-/// Accepts either the LiteParse standard response or the LlamaParse prod OCR+/// Accepts either the LiteParse standard response or the prod OCR/// worker response. Untagged: serde tries `Standard` first (keyed on/// `results` with object items), then falls back to `Prod` (keyed on `result`/// with positional-tuple items).@@ -107,8 +107,7 @@ pub struct HttpOcrEngine {retry: OcrRetryConfig,}-/// Retry/backoff policy for OCR HTTP requests. The defaults mirror the-/// LlamaParse worker's OCR retry semantics (`ocrRetryPolicy.ts`: up to 10+/// Retry/backoff policy for OCR HTTP requests. The default is up to 10/// attempts, 1s base backoff doubling to a 10s cap, plus jitter, with a fast/// path for dropped connections) so that liteparse-driven OCR is as resilient/// to a down / rate-limited `/ocr` endpoint as the legacy worker path was.@@ -450,7 +449,6 @@ mod tests {#[test]fn test_prod_response_deserializes() {- // LlamaParse prod worker shape: `result` tuples + `document_angle`.let raw = r#"{"document_angle":-90,"result":[[[[10.0,20.0],[60.0,20.0],[60.0,40.0],[10.0,40.0]],"hi",0.85]]}"#;let parsed: HttpOcrResponse = serde_json::from_str(raw).unwrap();let results = parsed.into_results();