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
f58a7a7d
Unverified
Commit
f58a7a7d
authored
Dec 07, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Dec 07, 2024
Browse files
Merge pull request #1222 from myhloli/dev
fix(dict2md): add space for inline equations in CJK contexts
parents
fa113b57
74ee428b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
magic_pdf/dict2md/ocr_mkcontent.py
magic_pdf/dict2md/ocr_mkcontent.py
+2
-2
No files found.
magic_pdf/dict2md/ocr_mkcontent.py
View file @
f58a7a7d
...
...
@@ -165,8 +165,8 @@ def merge_para_with_text(para_block):
if
content
:
langs
=
[
'zh'
,
'ja'
,
'ko'
]
# logger.info(f'block_lang: {block_lang}, content: {content}')
if
block_lang
in
langs
:
# 中文/日语/韩文语境下,换行不需要空格分隔
if
j
==
len
(
line
[
'spans'
])
-
1
:
if
block_lang
in
langs
:
# 中文/日语/韩文语境下,换行不需要空格分隔
,但是如果是行内公式结尾,还是要加空格
if
j
==
len
(
line
[
'spans'
])
-
1
and
span_type
not
in
[
ContentType
.
InlineEquation
]
:
para_text
+=
content
else
:
para_text
+=
f
'
{
content
}
'
...
...
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