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
fbc5ffab
authored
2022-06-14 15:03:18 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
cc6cdef0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
src/apps/doc/consts.py
src/apps/doc/ocr/wb.py
src/apps/doc/consts.py
View file @
fbc5ffa
...
...
@@ -1135,6 +1135,7 @@ NYZS_CLASSIFY = 18
SPECIAL_NYZS_CLASSIFY
=
50
MS_CLASSIFY
=
21
SPECIAL_ZSYH_CLASSIFY
=
20
EN_HEADER_LIST
=
[
'Date'
,
'Currency'
,
'Amount'
,
'Balance'
,
'TransactionType'
]
MS_ERROR_COL
=
(
5
,
6
)
WECHART_CLASSIFY
=
12
NEW_ZHIFUBAO_CLASSIFY
=
48
...
...
src/apps/doc/ocr/wb.py
View file @
fbc5ffa
...
...
@@ -503,8 +503,14 @@ class BSWorkbook(Workbook):
is_first_row
=
True
for
row_value
in
ws
.
iter_rows
(
min_row
=
part
[
1
],
max_row
=
part
[
2
],
values_only
=
True
):
if
any
(
row_value
):
if
classify
==
consts
.
SPECIAL_ZSYH_CLASSIFY
and
is_first_row
:
if
'Date'
in
row_value
and
'Balance'
in
row_value
:
if
classify
==
consts
.
SPECIAL_ZSYH_CLASSIFY
and
is_first_row
:
# 招商银行2行表头
find_count
=
0
for
tmp_idx
,
value_str
in
enumerate
(
row_value
):
if
tmp_idx
>=
len
(
consts
.
EN_HEADER_LIST
):
continue
if
value_str
.
find
(
consts
.
EN_HEADER_LIST
[
tmp_idx
])
!=
-
1
:
find_count
+=
1
if
find_count
>
1
:
is_first_row
=
False
continue
if
classify
==
consts
.
WECHART_CLASSIFY
:
...
...
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