openpaperwork / pyocr

A Python wrapper for Tesseract and Cuneiform -- Moved to Gnome's Gitlab
https://gitlab.gnome.org/World/OpenPaperwork/pyocr
931 stars 152 forks source link

pyocr does not support multiple languages. simple fix #71

Closed amitm02 closed 6 years ago

amitm02 commented 7 years ago

when trying set language to multiple languages, e.g. "heb+eng", there is an exception.

"image_to_string" function at libtesseract/init.py should be modified to something like:

        for lang_item in clang.split('+'):
            if lang_item not in tesseract_raw.get_available_languages(handle):
                raise TesseractError(
                 "no lang",
                 "language {} is not available".format(lang_item)
                )
jflesch commented 6 years ago

67c3ca2661b14193bf4ec213362dc9030334612f