Skip to content

Commit 0a33334

Browse files
authored
✨ support printing the OCR text in the CLI tool (#239)
1 parent e2cf8d4 commit 0a33334

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mindee/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ def call_parse(self) -> None:
361361
else:
362362
if response.document is None:
363363
raise MindeeClientError("Something went wrong during async parsing.")
364+
# print the OCR
365+
if self.parsed_args.include_words:
366+
print("#############\nDocument Text\n#############\n::\n")
367+
print(" " + str(response.document.ocr).replace("\n", "\n "))
368+
# print the response as rST
364369
print(self._doc_str(self.parsed_args.output_type, response.document))
365370

366371
def _parse_sync(self) -> PredictResponse:

0 commit comments

Comments
 (0)