Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragaeeb/kokokor/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This example demonstrates the simplest use case of Kokokor: taking raw OCR observations and reconstructing them into properly formatted paragraphs.Basic Usage
Expected Output
How It Works
Line Grouping
Kokokor groups observations on the same vertical line based on their y-coordinates and heights. Observations with similar vertical positions are merged into single lines.
Horizontal Sorting
Within each line, observations are sorted by x-coordinate to ensure proper reading order (left-to-right for LTR text).
Paragraph Detection
Lines are grouped into paragraphs by analyzing vertical spacing. Significant vertical gaps indicate paragraph breaks.
Complete Working Example
Key Points
Kokokor automatically handles:
- Line grouping based on vertical proximity
- Word ordering within lines
- Paragraph detection using spacing analysis
- DPI normalization for consistent results across different resolutions
Next Steps
Arabic Text
Learn how to process RTL text with the isRTL option
Poetry Documents
Handle documents with mixed prose and poetry
Multi-column
Work with complex layouts and footnotes
API Reference
Explore the complete API