|
@@ -9,7 +9,9 @@ def rule1_decorator(f, *args, **kwargs):
|
|
|
'''
|
|
|
predict_line = args[1]
|
|
|
predict_line = f(*args, **kwargs)
|
|
|
- idx = predict_line.index('')
|
|
|
+ idx = 0
|
|
|
+ if '' in predict_line:
|
|
|
+ idx = predict_line.index('')
|
|
|
try:
|
|
|
if idx == 1:
|
|
|
if '项目' in predict_line[0] and '每100克' in predict_line[2]:
|
|
@@ -97,7 +99,9 @@ def rule6_decorator(f, *args, **kwargs):
|
|
|
'''
|
|
|
predict_line = args[1]
|
|
|
predict_line = f(*args, **kwargs)
|
|
|
- idx = predict_line.index('')
|
|
|
+ idx = 0
|
|
|
+ if '' in predict_line:
|
|
|
+ idx = predict_line.index('')
|
|
|
try:
|
|
|
if idx == 1:
|
|
|
if '项目' in predict_line[0] and '每份' in predict_line[2] and '营养素参考值' in predict_line[2]:
|