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
195998a0
Commit
195998a0
authored
Mar 15, 2024
by
赵小蒙
Browse files
mk_mm_markdown2中span_type分类更新
parent
25a0fd06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
magic_pdf/dict2md/ocr_mkcontent.py
magic_pdf/dict2md/ocr_mkcontent.py
+4
-4
No files found.
magic_pdf/dict2md/ocr_mkcontent.py
View file @
195998a0
...
@@ -66,13 +66,13 @@ def mk_mm_markdown2(pdf_info_dict:dict):
...
@@ -66,13 +66,13 @@ def mk_mm_markdown2(pdf_info_dict:dict):
for
line
in
para
:
for
line
in
para
:
for
span
in
line
[
'spans'
]:
for
span
in
line
[
'spans'
]:
span_type
=
span
.
get
(
'type'
)
span_type
=
span
.
get
(
'type'
)
if
span_type
==
't
ext
'
:
if
span_type
==
ContentType
.
T
ext
:
para_text
+=
span
[
'content'
]
para_text
+=
span
[
'content'
]
elif
span_type
==
'i
nline
_e
quation
'
:
elif
span_type
==
ContentType
.
I
nline
E
quation
:
para_text
+=
f
" $
{
span
[
'content'
]
}
$ "
para_text
+=
f
" $
{
span
[
'content'
]
}
$ "
elif
span_type
==
'displayed_e
quation
'
:
elif
span_type
==
ContentType
.
InterlineE
quation
:
para_text
+=
f
"$$
\n
{
span
[
'content'
]
}
\n
$$ "
para_text
+=
f
"$$
\n
{
span
[
'content'
]
}
\n
$$ "
elif
span_type
==
'i
mage
'
:
elif
span_type
==
ContentType
.
I
mage
:
para_text
+=
f
" "
para_text
+=
f
" "
markdown
.
append
(
para_text
)
markdown
.
append
(
para_text
)
...
...
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