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
5513e48a
Commit
5513e48a
authored
Mar 12, 2024
by
liukaiwen
Browse files
add modify inline equation y axis
add false displayed equation to inline equation
parent
f9f36c10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
magic_pdf/pre_proc/ocr_dict_merge.py
magic_pdf/pre_proc/ocr_dict_merge.py
+1
-0
No files found.
magic_pdf/pre_proc/ocr_dict_merge.py
View file @
5513e48a
...
@@ -178,6 +178,7 @@ def modify_y_axis(spans: list):
...
@@ -178,6 +178,7 @@ def modify_y_axis(spans: list):
if
(
span_y0
<
y0
and
span_y
>
y0
or
span_y0
<
y1
and
span_y
>
y1
or
span_y0
<
y0
and
span_y
>
y1
)
and
__is_overlaps_y_exceeds_threshold
(
span
[
'bbox'
],
(
0
,
y0
,
0
,
y1
)):
if
(
span_y0
<
y0
and
span_y
>
y0
or
span_y0
<
y1
and
span_y
>
y1
or
span_y0
<
y0
and
span_y
>
y1
)
and
__is_overlaps_y_exceeds_threshold
(
span
[
'bbox'
],
(
0
,
y0
,
0
,
y1
)):
span
[
"bbox"
][
1
]
=
y0
span
[
"bbox"
][
1
]
=
y0
# span["bbox"][3] = y1
# span["bbox"][3] = y1
#调整公式类型
if
span
[
"type"
]
==
"displayed_equation"
:
if
span
[
"type"
]
==
"displayed_equation"
:
span
[
"type"
]
=
"inline_equation"
span
[
"type"
]
=
"inline_equation"
break
break
...
...
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