Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
68e83c12
Commit
68e83c12
authored
Mar 08, 2024
by
赵小蒙
Browse files
span进入具体的layout后,需要在下次循环前将该span移除
parent
17b09f71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
magic_pdf/pre_proc/ocr_dict_merge.py
magic_pdf/pre_proc/ocr_dict_merge.py
+4
-0
No files found.
magic_pdf/pre_proc/ocr_dict_merge.py
View file @
68e83c12
...
@@ -77,6 +77,10 @@ def merge_spans_to_line_by_layout(spans, layout_bboxes):
...
@@ -77,6 +77,10 @@ def merge_spans_to_line_by_layout(spans, layout_bboxes):
layout_sapns
.
append
(
span
)
layout_sapns
.
append
(
span
)
new_spans
.
append
(
layout_sapns
)
new_spans
.
append
(
layout_sapns
)
# 从spans删除已经放入layout_sapns中的span
for
layout_sapn
in
layout_sapns
:
spans
.
remove
(
layout_sapn
)
for
layout_sapns
in
new_spans
:
for
layout_sapns
in
new_spans
:
layout_lines
=
merge_spans_to_line
(
layout_sapns
)
layout_lines
=
merge_spans_to_line
(
layout_sapns
)
lines
.
extend
(
layout_lines
)
lines
.
extend
(
layout_lines
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment