Commit f5ee17a9 authored by David Martin's avatar David Martin

Simplify psm_parameter() with a conditional expression.

It is a bit more compact and arguably more Pythonic.
parent b95bdbcc
......@@ -164,10 +164,7 @@ def can_detect_orientation():
def psm_parameter():
"""Return the psm option string depending on the Tesseract version."""
version = get_version()
if version[0] <= 3:
return "-psm"
return "--psm"
return "--psm" if version[0] > 3 else "-psm"
def detect_orientation(image, lang=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment