More Tesseract-specific language checks to its plugin

This commit is contained in:
James R. Barlow
2024-06-01 00:15:50 -07:00
parent 653c4ffb45
commit 59f6bc8306
3 changed files with 18 additions and 13 deletions
-11
View File
@@ -52,17 +52,6 @@ def check_options_languages(
system_lang = locale.getlocale()[0]
if system_lang and not system_lang.startswith('en'):
log.debug("No language specified; assuming --language %s", DEFAULT_LANGUAGE)
DENIED_LANGUAGES = {'equ', 'osd'}
if DENIED_LANGUAGES & set(options.languages):
log.warning(
"The following languages for Tesseract's internal use and should not "
"be issued explicitly: "
f"{', '.join(DENIED_LANGUAGES)}\n"
"OCRmyPDF will ignore them."
)
options.languages = [
lang for lang in options.languages if lang not in DENIED_LANGUAGES
]
if not ocr_engine_languages:
return