pub struct TesseractOptions {
pub cmd: String,
pub lang: Option<String>,
pub psm: Option<u8>,
pub tessdata_dir: Option<String>,
}Expand description
How the tesseract binary is invoked.
Fields§
§cmd: StringCommand or path of the executable (DOCLING_TESSERACT, default
tesseract).
lang: Option<String>The -l argument — tessdata stems joined with +, already mapped by
lang_arg. None runs Tesseract’s own default (eng).
psm: Option<u8>Page segmentation mode (--psm, DOCLING_RS_TESSERACT_PSM, 0–13).
None keeps Tesseract’s default (3, fully automatic) — the right
choice for layout-region crops; 6 (one uniform block) or 11 (sparse
text) help on odd inputs.
tessdata_dir: Option<String>--tessdata-dir (DOCLING_RS_TESSDATA_DIR); None leaves the lookup
to Tesseract (TESSDATA_PREFIX, then its build-time default).
Implementations§
Source§impl TesseractOptions
impl TesseractOptions
Sourcepub fn from_env(lang: Option<String>) -> Self
pub fn from_env(lang: Option<String>) -> Self
The process-level options: lang from the caller (the mapped
ocr_lang), else DOCLING_RS_OCR_LANG read as Tesseract’s language
list (#889: DOCLING_RS_OCR_LANG=rus+eng in a container’s
environment never reached Tesseract, which ran its eng default; an
invalid value warns and leaves that default), the rest from the
environment. A DOCLING_RS_TESSERACT_PSM outside 0–13 warns and is
ignored.
Trait Implementations§
Source§impl Clone for TesseractOptions
impl Clone for TesseractOptions
Source§impl Debug for TesseractOptions
impl Debug for TesseractOptions
impl Eq for TesseractOptions
Source§impl PartialEq for TesseractOptions
impl PartialEq for TesseractOptions
impl StructuralPartialEq for TesseractOptions
Auto Trait Implementations§
impl Freeze for TesseractOptions
impl RefUnwindSafe for TesseractOptions
impl Send for TesseractOptions
impl Sync for TesseractOptions
impl Unpin for TesseractOptions
impl UnsafeUnpin for TesseractOptions
impl UnwindSafe for TesseractOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more