Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
135d5714
authored
2022-01-11 11:20:52 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
40ea31e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
src/common/electronic_hil_contract/get_char.py
src/common/tools/comparison.py
src/common/electronic_hil_contract/get_char.py
View file @
135d571
...
...
@@ -431,6 +431,8 @@ class Finder:
repayment_schedule_text_list
=
[]
table
=
False
page
=
None
left
=
0
right
=
0
for
pno
in
self
.
pdf_info
:
for
block
in
self
.
pdf_info
[
pno
][
'blocks'
]:
if
block
[
'type'
]
!=
0
:
...
...
@@ -438,6 +440,8 @@ class Finder:
for
line
in
block
[
'lines'
]:
for
span
in
line
[
'spans'
]:
bbox
,
text
=
span
[
'bbox'
],
span
[
'text'
]
if
'剩余融资'
in
text
:
right
=
bbox
[
2
]
if
'以上表格中所列序号'
in
text
:
table
=
False
if
table
==
True
:
...
...
@@ -448,10 +452,13 @@ class Finder:
if
re
.
findall
(
"
\
d+"
,
text
):
if
len
(
re
.
findall
(
"
\
d+"
,
text
))
==
1
:
continue
if
not
left
<
bbox
[
0
]
<
right
:
continue
repayment_schedule_text_list
.
append
(
text
)
if
'61.'
in
text
:
page
=
pno
table
=
True
left
=
bbox
[
0
]
# print("repayment_schedule_text_list = ", repayment_schedule_text_list)
# repayment_schedule_table = [['序号', '融资租赁成本', '融资租赁费用', '租金', '剩余融资租赁成本']]
repayment_schedule_table
=
[[
'序号'
,
'租金'
]]
...
...
src/common/tools/comparison.py
View file @
135d571
...
...
@@ -317,7 +317,7 @@ class Comparison:
def
se_date_compare
(
self
,
input_str
,
ocr_str
,
**
kwargs
):
if
kwargs
.
get
(
'long'
,
False
):
if
'长期'
in
ocr_str
or
'永久'
in
ocr_str
or
'***'
in
ocr_str
or
'至今'
in
ocr_str
or
'年—月—日'
in
ocr_str
or
'年 月 日'
in
ocr_str
:
if
'长期'
in
ocr_str
or
'永久'
in
ocr_str
or
'***'
in
ocr_str
or
'至今'
in
ocr_str
or
'年—月—日'
in
ocr_str
or
'年 月 日'
in
ocr_str
or
'年月日'
in
ocr_str
:
if
kwargs
.
get
(
'today'
,
False
)
or
input_str
in
[
'2099-12-31'
,
'2099-01-01'
,
'2999-12-31'
,
'2999-01-01'
]:
return
self
.
RESULT_Y
else
:
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment