// 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

/**
 * Tesseract OCR configuration.
 *
 * Provides fine-grained control over Tesseract OCR engine parameters.
 * Most users can use the defaults, but these settings allow optimization
 * for specific document types (invoices, handwriting, etc.).
 */
data class TesseractConfig(
    /** Language code (e.g., "eng", "deu", "fra") */
    val language: String = "eng",
    /**
     * Page Segmentation Mode (0-13).
     *
     * Common values:
     *
     * - 3: Fully automatic page segmentation (native default)
     * - 6: Assume a single uniform block of text (WASM default — avoids layout-analysis hang)
     * - 11: Sparse text with no particular order
     */
    val psm: Int = 3,
    /** Output format ("text" or "markdown") */
    val outputFormat: String = "markdown",
    /**
     * OCR Engine Mode (0-3).
     *
     * - 0: Legacy engine only
     * - 1: Neural nets (LSTM) only (usually best)
     * - 2: Legacy + LSTM
     * - 3: Default (based on what's available)
     */
    val oem: Int = 3,
    /**
     * Minimum confidence threshold (0.0-100.0).
     *
     * Words with confidence below this threshold may be rejected or flagged.
     */
    val minConfidence: Double = 0.0,
    /**
     * Image preprocessing configuration.
     *
     * Controls how images are preprocessed before OCR. Can significantly
     * improve quality for scanned documents or low-quality images.
     */
    val preprocessing: ImagePreprocessingConfig? = null,
    /** Enable automatic table detection and reconstruction */
    val enableTableDetection: Boolean = true,
    /** Minimum confidence threshold for table detection (0.0-1.0) */
    val tableMinConfidence: Double = 0.0,
    /** Column threshold for table detection (pixels) */
    val tableColumnThreshold: Int = 50,
    /** Row threshold ratio for table detection (0.0-1.0) */
    val tableRowThresholdRatio: Double = 0.5,
    /** Enable OCR result caching */
    val useCache: Boolean = true,
    /** Use pre-adapted templates for character classification */
    val classifyUsePreAdaptedTemplates: Boolean = true,
    /** Enable N-gram language model */
    val languageModelNgramOn: Boolean = false,
    /** Don't reject good words during block-level processing */
    val tesseditDontBlkrejGoodWds: Boolean = true,
    /** Don't reject good words during row-level processing */
    val tesseditDontRowrejGoodWds: Boolean = true,
    /** Enable dictionary correction */
    val tesseditEnableDictCorrection: Boolean = true,
    /** Whitelist of allowed characters (empty = all allowed) */
    val tesseditCharWhitelist: String = "",
    /** Blacklist of forbidden characters (empty = none forbidden) */
    val tesseditCharBlacklist: String = "",
    /** Use primary language params model */
    val tesseditUsePrimaryParamsModel: Boolean = true,
    /** Variable-width space detection */
    val textordSpaceSizeIsVariable: Boolean = true,
    /** Use adaptive thresholding method */
    val thresholdingMethod: Boolean = false,
)
