Update validation list
parent
674b5f4336
commit
0183f8f462
|
|
@ -211,7 +211,7 @@ class Lattice(BaseParser):
|
||||||
from ..ext.ghostscript import Ghostscript
|
from ..ext.ghostscript import Ghostscript
|
||||||
|
|
||||||
self.imagename = "".join([self.rootname, ".png"])
|
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
|
self.imagename, self.filename
|
||||||
)
|
)
|
||||||
gs_call = gs_call.encode().split()
|
gs_call = gs_call.encode().split()
|
||||||
|
|
@ -329,6 +329,7 @@ class Lattice(BaseParser):
|
||||||
|
|
||||||
table = Table(cols, rows)
|
table = Table(cols, rows)
|
||||||
# set table edges to True using ver+hor lines
|
# set table edges to True using ver+hor lines
|
||||||
|
|
||||||
table = table.set_edges(v_s, h_s, joint_tol=self.joint_tol)
|
table = table.set_edges(v_s, h_s, joint_tol=self.joint_tol)
|
||||||
# set table border edges to True
|
# set table border edges to True
|
||||||
table = table.set_border()
|
table = table.set_border()
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ class PlotMethods(object):
|
||||||
if filename is not None:
|
if filename is not None:
|
||||||
fig.savefig(filename)
|
fig.savefig(filename)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
def text(self, table):
|
def text(self, table):
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ def download_url(url):
|
||||||
return filepath
|
return filepath
|
||||||
|
|
||||||
|
|
||||||
stream_kwargs = ["columns", "edge_tol", "row_tol", "column_tol"]
|
|
||||||
lattice_kwargs = [
|
lattice_kwargs = [
|
||||||
"process_background",
|
"process_background",
|
||||||
"line_scale",
|
"line_scale",
|
||||||
|
|
@ -106,6 +105,7 @@ lattice_kwargs = [
|
||||||
"iterations",
|
"iterations",
|
||||||
"resolution",
|
"resolution",
|
||||||
]
|
]
|
||||||
|
stream_kwargs = ["columns", "edge_tol", "row_tol", "column_tol"]
|
||||||
|
|
||||||
|
|
||||||
def validate_input(kwargs, flavor="lattice"):
|
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}'"
|
f"{','.join(sorted(isec))} cannot be used with flavor='{flavor}'"
|
||||||
)
|
)
|
||||||
|
|
||||||
if flavor == "lattice":
|
if flavor in ["lattice", "lattice_ocr"]:
|
||||||
check_intersection(stream_kwargs, kwargs)
|
check_intersection(stream_kwargs, kwargs)
|
||||||
else:
|
else:
|
||||||
check_intersection(lattice_kwargs, kwargs)
|
check_intersection(lattice_kwargs, kwargs)
|
||||||
|
|
||||||
|
|
||||||
def remove_extra(kwargs, flavor="lattice"):
|
def remove_extra(kwargs, flavor="lattice"):
|
||||||
if flavor == "lattice":
|
if flavor in ["lattice", "lattice_ocr"]:
|
||||||
for key in kwargs.keys():
|
for key in kwargs.keys():
|
||||||
if key in stream_kwargs:
|
if key in stream_kwargs:
|
||||||
kwargs.pop(key)
|
kwargs.pop(key)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue