// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

/**
 * A unified OCR element representing detected text with full metadata.
 *
 * This is the primary type for structured OCR output, preserving all information
 * from both Tesseract and PaddleOCR backends.
 */
data class OcrElement(
    /** The recognized text content. */
    val text: String = "",
    /** Bounding geometry (rectangle or quadrilateral). */
    @field:com.fasterxml.jackson.databind.annotation.JsonSerialize(`as` = OcrBoundingGeometry::class)
    val geometry: OcrBoundingGeometry,
    /** Confidence scores for detection and recognition. */
    val confidence: OcrConfidence = OcrConfidence(),
    /** Hierarchical level (word, line, block, page). */
    val level: OcrElementLevel = OcrElementLevel.LINE,
    /** Rotation information (if detected). */
    val rotation: OcrRotation? = null,
    /** Page number (1-indexed). */
    val pageNumber: Int = 0,
    /**
     * Parent element ID for hierarchical relationships.
     *
     * Only used for Tesseract output which has word -> line -> block hierarchy.
     */
    val parentId: String? = null,
    /** Backend-specific metadata that doesn't fit the unified schema. */
    val backendMetadata: Map<String, Any> = emptyMap(),
)
