INNER CODE UNIT · Python
_EpsMap
pasteurlabs/tesseract-core · tesseract_core/runtime/cli.py:135
class _EpsMap(Mapping):
"""Per-input eps mapping that falls back to a global default.
Explicit overrides are returned for their paths; every other path
resolves to ``default``. Iteration yields only the explicit override
paths so that unknown-path validation can still catch typos, while
``__contains__`` reports every path as present so no path is ever
treated as missing.
"""
def __init__(self, overrides: Mapping[str, float], default: float) -> None:
self._overrides = dict(overrides)
self._default = default
def __getitem__(self, path: str) -> float:
return self._overrides.get(path, self._default)
def __contains__(self, path: object) -> bool: