Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
bom_identify
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5d2224c9
authored
Jan 26, 2021
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去掉R/r小数点后面的0
parent
b4b0b6a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
utils/functions.py
valid_server.py
utils/functions.py
View file @
5d2224c9
...
...
@@ -189,6 +189,12 @@ def get_not_exist_list(attrs_list, cut_list):
def
valid_encap
(
prefix
,
tail
):
"""
检查封装
:param prefix:
:param tail:
:return:
"""
prefix_flag
=
False
tail_flag
=
False
...
...
@@ -240,6 +246,11 @@ def check_symbol(kw):
def
check_param_r
(
kw
):
"""
确认是不是简写R/r
:param kw:
:return:
"""
check_res
=
r_pattern
.
findall
(
kw
)
if
not
check_res
:
check_res
=
False
...
...
@@ -249,7 +260,7 @@ def check_param_r(kw):
if
not
check_res
[
0
]
.
isalpha
()
and
not
check_res
[
2
]
.
isalpha
():
cut_list
=
re
.
split
(
'[Rr]'
,
check_res
[
1
])
if
not
cut_list
[
0
]
and
cut_list
[
1
]:
new_list
.
append
(
"0."
+
str
(
cut_list
[
1
]
)
+
"Ω"
)
new_list
.
append
(
str
(
delete_extra_zero
(
float
(
"0."
+
str
(
cut_list
[
1
])))
)
+
"Ω"
)
elif
cut_list
[
0
]
and
not
cut_list
[
1
]:
new_list
.
append
(
str
(
cut_list
[
0
])
+
"Ω"
)
else
:
...
...
valid_server.py
View file @
5d2224c9
...
...
@@ -129,17 +129,18 @@ class UCHandler(tornado.web.RequestHandler):
cut_list
=
cut_params
(
kw
)
unknown_list
=
get_not_exist_list
(
old_attrs_list
,
cut_list
)
for
kw_info
in
unknown_list
:
if
check_temp
(
kw_info
):
attrs_list
.
append
(
kw_info
)
elif
check_param_r
(
kw_info
):
attrs_list
.
append
(
check_param_r
(
kw_info
)[
0
])
else
:
encap_res
=
check_encap
(
kw_info
)
if
encap_res
:
encap_list
.
append
(
encap_res
)
if
kw_info
and
check_symbol
(
kw_info
)
and
not
encap_res
:
words_list
.
append
(
kw_info
)
if
kw_info
:
if
check_temp
(
kw_info
):
attrs_list
.
append
(
kw_info
)
elif
check_param_r
(
kw_info
):
attrs_list
.
append
(
check_param_r
(
kw_info
)[
0
])
else
:
encap_res
=
check_encap
(
kw_info
)
if
encap_res
:
encap_list
.
append
(
encap_res
)
if
check_symbol
(
kw_info
)
and
not
encap_res
:
words_list
.
append
(
kw_info
)
res
[
'status'
]
=
1
res
[
'words'
]
=
list
(
set
(
words_list
))
...
...
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