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
42159da8
authored
2020-11-23 11:37:42 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix keywords amount
1 parent
e3d719b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
src/apps/doc/ocr/wb.py
src/apps/doc/ocr/wb.py
View file @
42159da
...
...
@@ -400,7 +400,7 @@ class BSWorkbook(Workbook):
elif
classify
==
consts
.
NYYH_CLASSIFY
:
row_value
=
self
.
rm_second_row
(
row_value
,
amount_cell_idx
,
over_cell_idx
)
new_ws
.
append
(
row_value
)
# 3.2.提取信息、高亮
amount_mapping
=
{}
amount_fill_row
=
set
()
...
...
@@ -422,20 +422,6 @@ class BSWorkbook(Workbook):
outlay_cell_value
=
None
if
outlay_cell
is
None
else
outlay_cell
.
value
borrow_cell_value
=
None
if
borrow_cell
is
None
else
borrow_cell
.
value
# row = summary_cell.row
if
summary_cell
is
not
None
:
# 关键词1提取
if
summary_cell_value
in
self
.
interest_keyword
:
ms
.
append
((
summary_cell_value
,
date_cell_value
,
amount_cell_value
))
# 关键词2提取至临时表
elif
summary_cell_value
in
self
.
salary_keyword
:
tmp_ws
.
append
((
summary_cell_value
,
date_cell_value
,
amount_cell_value
))
# 贷款关键词高亮
elif
summary_cell_value
in
high_light_keyword
:
summary_cell
.
fill
=
self
.
amount_fill
if
amount_cell
is
not
None
:
amount_cell
.
fill
=
self
.
amount_fill
# 3.3.余额转数值
over_success
=
False
if
over_cell
is
not
None
:
...
...
@@ -491,6 +477,23 @@ class BSWorkbook(Workbook):
rows
[
result_idx
]
.
value
=
'=IF({2}{0}=ROUND(SUM({2}{1},{3}{0}),4), "{4}", "{5}")'
.
format
(
amount_cell
.
row
,
amount_cell
.
row
-
1
,
over_col_letter
,
amount_col_letter
,
*
self
.
proof_res
)
# 3.2.提取信息、高亮
# row = summary_cell.row
if
summary_cell
is
not
None
:
# 关键词1提取
if
summary_cell_value
in
self
.
interest_keyword
:
new_amount_cell_value
=
None
if
amount_cell
is
None
else
amount_cell
.
value
ms
.
append
((
summary_cell_value
,
date_cell_value
,
new_amount_cell_value
))
# 关键词2提取至临时表
elif
summary_cell_value
in
self
.
salary_keyword
:
new_amount_cell_value
=
None
if
amount_cell
is
None
else
amount_cell
.
value
tmp_ws
.
append
((
summary_cell_value
,
date_cell_value
,
new_amount_cell_value
))
# 贷款关键词高亮
elif
summary_cell_value
in
high_light_keyword
:
summary_cell
.
fill
=
self
.
amount_fill
if
amount_cell
is
not
None
:
amount_cell
.
fill
=
self
.
amount_fill
# 3.6.同一天相同进出账高亮
del
amount_mapping
for
row
in
amount_fill_row
:
...
...
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