|
1 | 1 | """Implementation of the Lattice table parser.""" |
2 | 2 |
|
3 | | -import copy |
4 | 3 | import os |
5 | | -import warnings |
6 | | - |
7 | | -import numpy as np |
8 | | -import pandas as pd |
9 | 4 |
|
10 | 5 | from ..backends.image_conversion import BACKENDS |
11 | 6 | from ..image_processing import adaptive_threshold |
@@ -65,12 +60,14 @@ class Lattice(BaseParser): |
65 | 60 | Size of a pixel neighborhood that is used to calculate a |
66 | 61 | threshold value for the pixel: 3, 5, 7, and so on. |
67 | 62 |
|
68 | | - For more information, refer `OpenCV's adaptiveThreshold <https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_. |
| 63 | + For more information, refer `OpenCV's adaptiveThreshold |
| 64 | + <https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_. |
69 | 65 | threshold_constant : int, optional (default: -2) |
70 | 66 | Constant subtracted from the mean or weighted mean. |
71 | 67 | Normally, it is positive but may be zero or negative as well. |
72 | 68 |
|
73 | | - For more information, refer `OpenCV's adaptiveThreshold <https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_. |
| 69 | + For more information, refer `OpenCV's adaptiveThreshold |
| 70 | + <https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#adaptivethreshold>`_. |
74 | 71 | iterations : int, optional (default: 0) |
75 | 72 | Number of times for erosion/dilation is applied. |
76 | 73 |
|
@@ -131,14 +128,14 @@ def implements_convert(): |
131 | 128 | if isinstance(backend, str): |
132 | 129 | if backend not in BACKENDS.keys(): |
133 | 130 | raise NotImplementedError( |
134 | | - f"Unknown backend '{backend}' specified. Please use either 'poppler' or 'ghostscript'." |
| 131 | + f"Unknown backend {backend!r} specified. Please use either 'poppler' or 'ghostscript'." |
135 | 132 | ) |
136 | 133 |
|
137 | 134 | return BACKENDS[backend]() |
138 | 135 | else: |
139 | 136 | if not implements_convert(): |
140 | 137 | raise NotImplementedError( |
141 | | - f"'{backend}' must implement a 'convert' method" |
| 138 | + f"{backend!r} must implement a 'convert' method" |
142 | 139 | ) |
143 | 140 |
|
144 | 141 | return backend |
|
0 commit comments