回答編集履歴
2
Update
test
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
for l, v in re.findall(rf'({"|".join(labels.keys())})(.)', text):
|
22
22
|
|
23
|
-
labels[l] += vals[v] if v in vals
|
23
|
+
labels[l] += vals[v] if v in vals else 0
|
24
24
|
|
25
25
|
|
26
26
|
|
1
Update
test
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
for l, v in re.findall(rf'({"|".join(labels.keys())})(.)', text):
|
22
22
|
|
23
|
-
labels[l] += vals[v]
|
23
|
+
labels[l] += vals[v] if v in vals.keys() else 0
|
24
24
|
|
25
25
|
|
26
26
|
|