mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-03-27 11:08:32 +07:00
feat: improve text block merging by ensuring both blocks have lines before merging
This commit is contained in:
@@ -260,7 +260,7 @@ def __is_list_or_index_block(block):
|
||||
|
||||
|
||||
def __merge_2_text_blocks(block1, block2):
|
||||
if len(block1['lines']) > 0:
|
||||
if len(block1['lines']) > 0 and len(block2['lines']) > 0:
|
||||
first_line = block1['lines'][0]
|
||||
line_height = first_line['bbox'][3] - first_line['bbox'][1]
|
||||
block1_weight = block1['bbox'][2] - block1['bbox'][0]
|
||||
|
||||
Reference in New Issue
Block a user