//! Framework adapter implementations

pub mod external;
pub mod kreuzberg;
pub mod subprocess;

pub use external::{
    create_docling_adapter, create_markitdown_adapter, create_mineru_adapter, create_pandoc_adapter,
    create_pdfminer_adapter, create_pdfplumber_adapter, create_pdftotext_adapter, create_playa_pdf_adapter,
    create_pymupdf4llm_adapter, create_pypdf_adapter, create_tika_adapter, create_unstructured_adapter,
};
pub use kreuzberg::create_kreuzberg_adapter;
pub use subprocess::SubprocessAdapter;

/// Returns the OCR flag string based on the provided boolean
pub(crate) fn ocr_flag(ocr_enabled: bool) -> String {
    if ocr_enabled {
        "--ocr".to_string()
    } else {
        "--no-ocr".to_string()
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_ocr_flag_when_enabled() {
        let result = ocr_flag(true);
        assert_eq!(result, "--ocr", "Should return '--ocr' when enabled");
    }

    #[test]
    fn test_ocr_flag_when_disabled() {
        let result = ocr_flag(false);
        assert_eq!(result, "--no-ocr", "Should return '--no-ocr' when disabled");
    }
}
