Reads :tesseract_js Application config with sensible defaults and resolves
the paths the browser needs (workerPath, corePath, langPath) for either CDN
or local mode.
Config keys:
config :tesseract_js,
base_path: "/assets/vendor/tesseract", # where local files live (when source: :local)
lang: "eng", # default language
source: :cdn, # :cdn (default) or :local
tessdata_repo: :standard, # :standard | :best | :fast
core_variant: :simd_lstm # :simd_lstm | :simd | :basic
Summary
Functions
Just the base_path used for local-mode asset URLs.
Returns the merged config map (defaults ← Application env ← overrides).
Returns the runtime configuration the browser needs
Functions
Just the base_path used for local-mode asset URLs.
Returns the merged config map (defaults ← Application env ← overrides).
Returns the runtime configuration the browser needs:
%{
workerPath: "/assets/vendor/tesseract/worker.min.js",
corePath: "<cdn or local>/tesseract-core-simd-lstm.wasm.js",
langPath: "<cdn or local>",
lang: "eng",
oem: 1
}This is what the <.script /> component serializes into
window.__tesseractJs. The JS wrapper reads these defaults at boot.
Notes:
workerPathis always served from the package's vendored files (small, no benefit to CDN).corePathandlangPathflip based onsource.- For CDN mode,
langPathpoints at the parent jsDelivr directory so tesseract.js's worker can build per-lang URLs from it.