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
bb699679
authored
Jun 13, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化位号列识别,增加static_config
parent
ed1a6f27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
predict/base_handler.py
static_config.py
predict/base_handler.py
View file @
bb699679
...
@@ -178,7 +178,7 @@ class BasePredictor:
...
@@ -178,7 +178,7 @@ class BasePredictor:
位号列预测
位号列预测
"""
"""
# pat = re.compile(r'[CJRULX][1-9]{1,3}')
# pat = re.compile(r'[CJRULX][1-9]{1,3}')
pat
=
re
.
compile
(
r'(?<!.)[CJRULX][1-9]{1,3}(?![^,,/ ])'
)
pat
=
re
.
compile
(
r'(?<!.)[CJRULX
KPD
][1-9]{1,3}(?![^,,/ ])'
)
count
=
0
count
=
0
for
i
in
data
:
for
i
in
data
:
if
pat
.
findall
(
str
(
i
)):
if
pat
.
findall
(
str
(
i
)):
...
@@ -212,4 +212,4 @@ class BasePredictor:
...
@@ -212,4 +212,4 @@ class BasePredictor:
return
round
(
count
/
len
(
data
),
3
)
return
round
(
count
/
len
(
data
),
3
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
(
BasePredictor
.
is_
num
([
3400.0
,
5920.0
,
4849.0
,
2544.0
,
3270.0
,
52751.0
,
2031.0
,
5302.0
,
726.0
,
1247.0
,
2472.0
,
689.0
,
6049.0
,
26796.0
,
6164.0
,
1605.0
,
4346.0
,
640.0
,
960.0
,
960.0
,
320.0
,
160.0
,
860.0
,
160.0
,
320.0
,
3183.0
,
10151.0
,
640.0
,
130.0
,
1237.0
,
800.0
,
960.0
,
3740.0
,
17701.0
,
2146.0
,
1280.0
,
160.0
,
1120.0
,
160.0
,
480.0
,
960.0
,
480.0
,
160.0
,
4717.0
,
160.0
,
160.0
,
160.0
,
640.0
,
160.0
,
320.0
,
160.0
,
160.0
,
800.0
,
800.0
,
480.0
,
1600.0
,
155.0
,
960.0
,
320.0
,
944.0
,
160.0
,
160.0
,
1280.0
,
1852.0
,
7680.0
,
7680.0
,
2880.0
,
160.0
,
224.0
,
480.0
,
480.0
,
640.0
,
160.0
,
640.0
,
320.0
,
1760.0
,
640.0
,
480.0
,
960.0
,
160.0
,
160.0
,
160.0
,
160.0
,
1920.0
,
160.0
,
5600.0
,
480.0
,
2560.0
,
160.0
,
160.0
,
160.0
,
160.0
,
160.0
,
1280.0
,
160.0
,
160.0
,
160.0
,
160.0
,
160.0
,
320.0
,
0.0
,
160.0
,
160.0
]))
print
(
BasePredictor
.
is_
ref
([
'?'
,
'位号'
,
'C75,C149'
,
'C59 C252,C5302'
,
'C49,C50'
,
'C5323,C5324,C5337'
,
'C5261,C5262'
,
'C5312'
,
'C419'
,
'C7,C26,C27,C133'
,
'C37,C108,C109,C110,C111,C127,C194,C248,C123,C420'
,
'C5189,C5291,C5332'
,
'C255,C5190,C5292,C5333 C5267,C5272'
,
'C107,C116'
,
'C5309,C5340,C5343'
,
'C423,C426'
,
'C66,C76,C5265,C5266,C5270,C5271,C5326,C5253,C5254,C5255,C5256,C5257,C5258,C5259,C5260,C5263,C5264,C5306'
,
'C2,C3,C4,C10,C14,C15,C16,C35,C52,C54,C55,C56,C57,C72,C73,C77,C78,C83,C85,C86,C87,C88,C89,C91,C92,C93,C94,C95,C96,C97,C98,C99,C100,C101,C102,C103,C104,C105,C128,C154,C156,C159,C162,C163,C165,C166,C169,C170,C180,C189,C193,C197,C205,C235,C243,C244,C246,C251,C258,C262,C263,C264,C266,C271,C334,C335,C615,C5188,C5229,C5235,C5290,C5294,C5296,C5299,C5300,C5301,C5316,C5331,C5335,C5345,C18,C117,C353,C362,C363,C377,C378,C380,C424,C425,C5206,C5223,C5226,C5228,C5230,C5231,C5233,C5234,C5240,C5242,C5243,C5245,C5247,C5248,C5249,C5251,C5252,C5268,C5269,C5342,C5344,C5346,C421,C5303,C5305'
,
'C39,C68,C82,C84,C90,C142,C247,C250,C280,C435'
,
'C5338,C5339'
,
'C151 C427'
,
'C38,C40,C155,C157,C215,C254,C257,C260,C261,C270,C5314 C150 C181 C5224'
,
'C17,C29,C62,C63,C64,C65,C67,C106,C121,C122,C161,C164,C303,C422,C5244,C5298,C5341,C183,C5304'
,
'C1,C8,C9,C12,C19,C51,C53,C136,C168,C5193,C5207,C5208,C5293,C5315,C428,C5227,C5232,C5241,C5246,C5250,C5276,C5313,C5327,C5328,C5329,C5330'
,
'C13,C21,C69,C70,C81'
,
'C396'
,
'C364'
,
'CE5'
,
'CE3,CE4'
,
'CE1,CE2'
,
'R8,R9,R10,R56,R66,R84,R164,R226,R238,R240,R311,R312,R348,R5812,R5889,R5890 R5887'
,
'R5731,R5732,R5742,R5743,R5744,R5745,R5922,R5923'
,
'R58,R78,R172,R173'
,
'R143,R398,R399,R5801,R5802,R5862,R5863,R5864,R5865,R5866,R5867'
,
'R4,R5,R11,R25,R28,R67,R5750,R5751,R5752,R5753,R5787,R5810,R5822'
,
'R59'
,
'R36,R37'
,
'R5828'
,
'R239,R241'
,
'R38'
,
'R70,R71,R123'
,
'R1,R280,R5785,R5789,R5797,R5824,R5825,R5830,R5831,R5897'
,
'R405,R5768 R5888'
,
'R115 R400,R401,R5920'
,
'R5826,R5827,R5829,R5832'
,
'R151'
,
'R407'
,
'R5807'
,
'R101,R117,R144,R150,R153,R156,R157,R159,R161,R162,R307,R5704,R5706,R5748,R5749,R5869,R5874'
,
'R96,R137'
,
'R5723,R5857,R5916'
,
'R136'
,
'R5771 R5858'
,
'R12,R31,R32,R33,R34,R35,R42,R44,R61,R77,R80,R125,R132,R140,R141,R193,R212,R267,R419,R5144,R5765,R5766,R5767,R5786,R5800,R5808,R5809,R5815,R5816,R5817,R5894,R5892,R5895,R5896,R5907,R5908,R5910,R5911,R5913,R5914,R5921'
,
'R139 R5861'
,
'R92,R138'
,
'R5147,R5891'
,
'R45,R5903,R5905,R5906'
,
'R64'
,
'R21'
,
'R65,R5770,R5772'
,
'R5724,R5769'
,
'R5782'
,
'R23,R26,R30,R39,R126,R127,R5722,R5779,R5781,R5783,R5784,R5798,R5799,R5805,R5813,R5814,R5823,R5856,R5915,R5924 R5917'
,
'R20,R24,R27 R5859'
,
'R29'
,
'R43,R49'
,
'R5725'
,
'R128,R129'
,
'R5898 R5918'
,
'L6,L16 R13'
,
'R2,R3'
,
'R130,R131'
,
'L5103'
,
'RN2,RN3'
,
'RP1,RP2'
,
'FB9,FB10,FB12 L53,L5107,L5108'
,
'L22'
,
'L7'
,
'L24 L5101,L5106,L5109'
,
'L3,L4'
,
'L2,L5 L9'
,
'X6'
,
'Y1'
,
'Y2'
,
'Y3'
,
'Y5'
,
'F1'
,
'D7 D33,D34 D45'
,
'D40,D41'
,
'D4,D47'
,
'D1'
,
'D5'
,
'D46'
,
'Q1,Q3 Q11'
,
'Q23 1Q1'
,
'U5116'
,
'U1'
,
'U5119'
,
'U2'
,
'U5115'
,
'U5110,U5128,U5133'
,
'U9,U12'
,
'U8,U11'
,
'U13'
,
'U5120 U5124 '
,
'U19 U5118,U5121,U5123'
,
'U10'
,
'U20'
,
'U31'
,
'U5113'
,
'U5122'
,
'U5130'
,
'U5132'
,
'U5134'
,
'U3'
,
'U5,U6'
,
'U5126'
,
'P11'
,
'ESD1,D13,D14,D15,D16,D17,D18,D19,ESD39,ESD40,ESD41,ESD42,ESD43,ESD44,ESD45,ESD46,ESD47,ESD48,D48,ESD49,ESD55,ESD56,ESD57,ESD61,ESD62,ESD63,ESD64,ESD65,ESD66,ESD67,ESD68,ESD69,ESD70'
,
'TVS2'
,
',P1,P2,P5,P10,P4617,P4618,P4620,P4621,P4625'
,
'P7'
,
'K1'
,
'J5'
,
'J33'
,
'ANT1'
,
'J4604,MIC1,MIC2'
,
'J2 CN2'
,
'J4601,J4602'
,
'CTP'
,
'J4605'
,
'SW1'
,
'BAT1'
,
'?'
]))
static_config.py
View file @
bb699679
...
@@ -5,15 +5,15 @@ PROB_FIELDS = ["序号", "名称", "规格", "mpn", "用量(pcs)", "用量", "pc
...
@@ -5,15 +5,15 @@ PROB_FIELDS = ["序号", "名称", "规格", "mpn", "用量(pcs)", "用量", "pc
"需求数量"
,
"售价"
,
"封装"
,
"封装规格"
,
'型号'
,
'参数'
,
'数量'
,
'品牌'
,
'型号'
,
'类型'
,
"quantity"
,
"qty"
,
"buy qty"
,
"需求数量"
,
"售价"
,
"封装"
,
"封装规格"
,
'型号'
,
'参数'
,
'数量'
,
'品牌'
,
'型号'
,
'类型'
,
"quantity"
,
"qty"
,
"buy qty"
,
"buy quantity"
,
"需求用量"
,
"manufacturer制造商"
,
"manufacturer"
,
"description"
"buy quantity"
,
"需求用量"
,
"manufacturer制造商"
,
"manufacturer"
,
"description"
"参考品牌"
,
"品牌"
,
"item"
,
"厂商编码"
,
"品牌/厂商"
,
"参考料号"
,
"参考供应商"
,
"top面"
,
"bottom面"
,
"designator"
,
"remark"
,
"元器件"
,
"参考品牌"
,
"品牌"
,
"item"
,
"厂商编码"
,
"品牌/厂商"
,
"参考料号"
,
"参考供应商"
,
"top面"
,
"bottom面"
,
"designator"
,
"remark"
,
"元器件"
,
"标号"
,
"需求型号"
]
"标号"
,
"需求型号"
,
"Footprint封装"
,
"Footprint"
,
"产品分类"
,
"单板数量"
,
"规格型号"
,
"packagereference"
,
"footprint封装"
]
PROB_FIELDS_1
=
[
'*'
+
i
for
i
in
PROB_FIELDS
]
PROB_FIELDS_1
=
[
'*'
+
i
for
i
in
PROB_FIELDS
]
PROB_FIELDS
.
extend
(
PROB_FIELDS_1
)
PROB_FIELDS
.
extend
(
PROB_FIELDS_1
)
# 标准名和代名词的映射
# 标准名和代名词的映射
li_category
=
[
"类别"
,
"分类"
,
"名称"
,
"类别名称"
,
"类型"
]
li_category
=
[
"类别"
,
"分类"
,
"名称"
,
"类别名称"
,
"类型"
,
"产品分类"
]
li_param
=
[
"参数"
,
"规格"
,
"描述"
,
"值"
,
"description"
]
li_param
=
[
"参数"
,
"规格"
,
"描述"
,
"值"
,
"description"
]
li_gn
=
[
"型号"
,
"参考料号"
,
"料号"
,
"mpn"
,
"厂商编码"
,
"元器件"
,
"需求型号"
]
li_gn
=
[
"型号"
,
"参考料号"
,
"料号"
,
"mpn"
,
"厂商编码"
,
"元器件"
,
"需求型号"
,
"规格型号"
]
li_num
=
[
"数量"
,
"用量(pcs)"
,
"用量"
,
"pcs"
,
"quantity"
,
"qty"
,
"buy qty"
,
"buy quantity"
,
"需求用量"
]
li_num
=
[
"数量"
,
"用量(pcs)"
,
"用量"
,
"pcs"
,
"quantity"
,
"qty"
,
"buy qty"
,
"buy quantity"
,
"需求用量"
,
"单板数量"
]
li_brand
=
[
"品牌"
,
"品牌/厂商"
,
"参考品牌"
,
"参考供应商"
,
"厂商"
,
"参考供应商"
,
"参考厂商"
,
"manufacturer制造商"
,
"manufacturer"
]
li_brand
=
[
"品牌"
,
"品牌/厂商"
,
"参考品牌"
,
"参考供应商"
,
"厂商"
,
"参考供应商"
,
"参考厂商"
,
"manufacturer制造商"
,
"manufacturer"
]
li_category
.
extend
([
'*'
+
i
for
i
in
li_category
])
li_category
.
extend
([
'*'
+
i
for
i
in
li_category
])
...
...
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