|
14 | 14 | import xml.dom.minidom
|
15 | 15 | import logging
|
16 | 16 |
|
17 |
| -from .tesseract import psm_parameter |
| 17 | +import pyocr.tesseract |
18 | 18 | from .util import to_unicode
|
19 | 19 |
|
20 | 20 | logger = logging.getLogger(__name__)
|
@@ -306,7 +306,7 @@ class TextBuilder(BaseBuilder):
|
306 | 306 | def __init__(self, tesseract_layout=3, cuneiform_dotmatrix=False,
|
307 | 307 | cuneiform_fax=False, cuneiform_singlecolumn=False):
|
308 | 308 | file_ext = ["txt"]
|
309 |
| - tess_flags = [psm_parameter(), str(tesseract_layout)] |
| 309 | + tess_flags = [pyocr.tesseract.psm_parameter(), str(tesseract_layout)] |
310 | 310 | cun_args = ["-f", "text"]
|
311 | 311 | # Add custom cuneiform parameters if needed
|
312 | 312 | for par, arg in [(cuneiform_dotmatrix, "--dotmatrix"),
|
@@ -563,7 +563,7 @@ class WordBoxBuilder(BaseBuilder):
|
563 | 563 |
|
564 | 564 | def __init__(self, tesseract_layout=1):
|
565 | 565 | file_ext = ["html", "hocr"]
|
566 |
| - tess_flags = [psm_parameter(), str(tesseract_layout)] |
| 566 | + tess_flags = [pyocr.tesseract.psm_parameter(), str(tesseract_layout)] |
567 | 567 | tess_conf = ["hocr"]
|
568 | 568 | cun_args = ["-f", "hocr"]
|
569 | 569 | super(WordBoxBuilder, self).__init__(file_ext, tess_flags, tess_conf,
|
@@ -639,7 +639,7 @@ class LineBoxBuilder(BaseBuilder):
|
639 | 639 |
|
640 | 640 | def __init__(self, tesseract_layout=1):
|
641 | 641 | file_ext = ["html", "hocr"]
|
642 |
| - tess_flags = [psm_parameter(), str(tesseract_layout)] |
| 642 | + tess_flags = [pyocr.tesseract.psm_parameter(), str(tesseract_layout)] |
643 | 643 | tess_conf = ["hocr"]
|
644 | 644 | cun_args = ["-f", "hocr"]
|
645 | 645 | super(LineBoxBuilder, self).__init__(file_ext, tess_flags, tess_conf,
|
|
0 commit comments