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
927fc6ca
Unverified
Commit
927fc6ca
authored
Nov 13, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Nov 13, 2024
Browse files
Merge pull request #943 from myhloli/dev
fix(ocr_mkcontent): improve handling of single-character content #937
parents
37b36df5
2de1d0ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
magic_pdf/dict2md/ocr_mkcontent.py
magic_pdf/dict2md/ocr_mkcontent.py
+1
-1
No files found.
magic_pdf/dict2md/ocr_mkcontent.py
View file @
927fc6ca
...
@@ -168,7 +168,7 @@ def merge_para_with_text(para_block):
...
@@ -168,7 +168,7 @@ def merge_para_with_text(para_block):
# 如果是前一行带有-连字符,那么末尾不应该加空格
# 如果是前一行带有-连字符,那么末尾不应该加空格
if
__is_hyphen_at_line_end
(
content
):
if
__is_hyphen_at_line_end
(
content
):
para_text
+=
content
[:
-
1
]
para_text
+=
content
[:
-
1
]
elif
len
(
content
)
==
1
and
content
not
in
[
'A'
,
'I'
,
'a'
,
'i'
]:
elif
len
(
content
)
==
1
and
content
not
in
[
'A'
,
'I'
,
'a'
,
'i'
]
and
not
content
.
isdigit
()
:
para_text
+=
content
para_text
+=
content
else
:
# 西方文本语境下 content间需要空格分隔
else
:
# 西方文本语境下 content间需要空格分隔
para_text
+=
f
"
{
content
}
"
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