@@ -924,10 +924,10 @@ def flag_font_size(textline, direction, strip_text=""):
924924 for t in textline
925925 if not isinstance (t , LTAnno )
926926 ]
927- l = [np .round (size , decimals = 6 ) for text , size in d ]
928- if len (set (l )) > 1 :
927+ le = [np .round (size , decimals = 6 ) for text , size in d ]
928+ if len (set (le )) > 1 :
929929 flist = []
930- min_size = min (l )
930+ min_size = min (le )
931931 for key , chars in groupby (d , itemgetter (1 )):
932932 if key == min_size :
933933 fchars = [t [0 ] for t in chars ]
@@ -1141,10 +1141,10 @@ def get_table_index(
11411141 x0_offset = abs (t .x0 - table .cols [c_idx ][0 ])
11421142 if t .x1 > table .cols [c_idx ][1 ]:
11431143 x1_offset = abs (t .x1 - table .cols [c_idx ][1 ])
1144- X = 1.0 if abs (t .x0 - t .x1 ) == 0.0 else abs (t .x0 - t .x1 )
1145- Y = 1.0 if abs (t .y0 - t .y1 ) == 0.0 else abs (t .y0 - t .y1 )
1146- charea = X * Y
1147- error = ((X * (y0_offset + y1_offset )) + (Y * (x0_offset + x1_offset ))) / charea
1144+ x = 1.0 if abs (t .x0 - t .x1 ) == 0.0 else abs (t .x0 - t .x1 )
1145+ y = 1.0 if abs (t .y0 - t .y1 ) == 0.0 else abs (t .y0 - t .y1 )
1146+ charea = x * y
1147+ error = ((x * (y0_offset + y1_offset )) + (y * (x0_offset + x1_offset ))) / charea
11481148
11491149 if split_text :
11501150 return (
@@ -1307,18 +1307,18 @@ def get_text_objects(layout, ltype="char", t=None):
13071307
13081308 """
13091309 if ltype == "char" :
1310- LTObject = LTChar
1310+ LTObject = LTChar # noqa
13111311 elif ltype == "image" :
1312- LTObject = LTImage
1312+ LTObject = LTImage # noqa
13131313 elif ltype == "horizontal_text" :
1314- LTObject = LTTextLineHorizontal
1314+ LTObject = LTTextLineHorizontal # noqa
13151315 elif ltype == "vertical_text" :
1316- LTObject = LTTextLineVertical
1316+ LTObject = LTTextLineVertical # noqa
13171317 if t is None :
13181318 t = []
13191319 try :
13201320 for obj in layout ._objs :
1321- if isinstance (obj , LTObject ):
1321+ if isinstance (obj , LTObject ): # noqa
13221322 t .append (obj )
13231323 else :
13241324 t += get_text_objects (obj , ltype = ltype )
0 commit comments