Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
8411c910
Commit
8411c910
authored
Jul 23, 2024
by
myhloli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(magic_pdf): prevent division by zero in citationmarker removal
parent
e51d3e79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
citationmarker_remove.py
magic_pdf/pre_proc/citationmarker_remove.py
+5
-1
No files found.
magic_pdf/pre_proc/citationmarker_remove.py
View file @
8411c910
...
@@ -135,7 +135,11 @@ def remove_citation_marker(with_char_text_blcoks):
...
@@ -135,7 +135,11 @@ def remove_citation_marker(with_char_text_blcoks):
if
max_font_sz
-
span_font_sz
<
1
:
# 先以字体过滤正文,如果是正文就不再继续判断了
if
max_font_sz
-
span_font_sz
<
1
:
# 先以字体过滤正文,如果是正文就不再继续判断了
continue
continue
# 对被除数为0的情况进行过滤
if
span_hi
==
0
or
min_font_sz
==
0
:
continue
if
(
base_span_mid_y
-
span_mid_y
)
/
span_hi
>
0.2
or
(
base_span_mid_y
-
span_mid_y
>
0
and
abs
(
span_font_sz
-
min_font_sz
)
/
min_font_sz
<
0.1
):
if
(
base_span_mid_y
-
span_mid_y
)
/
span_hi
>
0.2
or
(
base_span_mid_y
-
span_mid_y
>
0
and
abs
(
span_font_sz
-
min_font_sz
)
/
min_font_sz
<
0.1
):
"""
"""
1. 它的前一个char如果是句号或者逗号的话,那么肯定是角标而不是公式
1. 它的前一个char如果是句号或者逗号的话,那么肯定是角标而不是公式
...
...
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