Update validation list

add-ocr
Vinayak Mehta 2020-11-18 18:51:09 +05:30
parent 674b5f4336
commit 0183f8f462
No known key found for this signature in database
GPG Key ID: 2170CDB940114C1D
3 changed files with 6 additions and 5 deletions

View File

@ -211,7 +211,7 @@ class Lattice(BaseParser):
from ..ext.ghostscript import Ghostscript
self.imagename = "".join([self.rootname, ".png"])
gs_call = "-q -sDEVICE=png16m -o {} -r300 {}".format(
gs_call = "-q -sDEVICE=png16m -o {} -r900 {}".format(
self.imagename, self.filename
)
gs_call = gs_call.encode().split()
@ -329,6 +329,7 @@ class Lattice(BaseParser):
table = Table(cols, rows)
# set table edges to True using ver+hor lines
table = table.set_edges(v_s, h_s, joint_tol=self.joint_tol)
# set table border edges to True
table = table.set_border()

View File

@ -48,7 +48,7 @@ class PlotMethods(object):
if filename is not None:
fig.savefig(filename)
return None
return fig
def text(self, table):

View File

@ -93,7 +93,6 @@ def download_url(url):
return filepath
stream_kwargs = ["columns", "edge_tol", "row_tol", "column_tol"]
lattice_kwargs = [
"process_background",
"line_scale",
@ -106,6 +105,7 @@ lattice_kwargs = [
"iterations",
"resolution",
]
stream_kwargs = ["columns", "edge_tol", "row_tol", "column_tol"]
def validate_input(kwargs, flavor="lattice"):
@ -116,14 +116,14 @@ def validate_input(kwargs, flavor="lattice"):
f"{','.join(sorted(isec))} cannot be used with flavor='{flavor}'"
)
if flavor == "lattice":
if flavor in ["lattice", "lattice_ocr"]:
check_intersection(stream_kwargs, kwargs)
else:
check_intersection(lattice_kwargs, kwargs)
def remove_extra(kwargs, flavor="lattice"):
if flavor == "lattice":
if flavor in ["lattice", "lattice_ocr"]:
for key in kwargs.keys():
if key in stream_kwargs:
kwargs.pop(key)