OCRAlgorithm

class OCRAlgorithm(instructions: list[BaseInstruction], text_reader: BaseTextReader | None = None, debugger: BaseDebugger | bool = True)[source]

Bases: BaseAlgorithm

Run instruction sequences that depend on OCR data.

property id: int

Return the unique algorithm identifier.

Returns:

Algorithm identifier.

Return type:

int

perform(ui: BaseUi, *args, **kwargs)[source]

Execute the algorithm for the provided UI context.

Parameters:
  • ui (BaseUi) – UI instance used during execution.

  • args – Additional positional arguments for the execution flow.

  • kwargs – Additional keyword arguments for the execution flow.

add_instruction(instruction: BaseInstruction)[source]

Add an instruction to the algorithm sequence.

Parameters:

instruction – Instruction to append.

property instructions: list[BaseInstruction]

Return the configured instructions.

Returns:

Instructions managed by the algorithm.