OCRInstruction

class OCRInstruction[source]

Bases: BaseInstruction

Define the common interface for OCR-based instructions.

abstract property id: int

Return the unique OCR instruction identifier.

Returns:

OCR instruction identifier.

Return type:

int

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

Execute the instruction with a text reader.

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

  • text_reader (BaseTextReader) – Text reader used to detect text.

  • args – Additional positional arguments for the execution flow.

  • kwargs – Additional keyword arguments for the execution flow.

Returns:

Updated UI state when the implementation returns it.

Return type:

BaseUi