回答編集履歴
2
アスタリスクの展開を2箇所追加
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
lambda *args: args[1] > 0,
|
26
26
|
|
27
|
-
map(costy_eval, zip(product(uniqterms, word)))
|
27
|
+
map(costy_eval, *zip(*product(uniqterms, word)))
|
28
28
|
|
29
29
|
)]
|
30
30
|
|
@@ -42,6 +42,8 @@
|
|
42
42
|
|
43
43
|
- 追記:costy_evalの引数が2個なのでproductにzipを追加。mapの使い方を間違えてました。
|
44
44
|
|
45
|
+
- 追記2:アスタリスクを二つ足したのでもう速くなさそうなコードになりました。
|
46
|
+
|
45
47
|
'''
|
46
48
|
|
47
49
|
```
|
1
productにzip追加
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
lambda *args: args[1] > 0,
|
26
26
|
|
27
|
-
map(costy_eval, product(uniqterms, word))
|
27
|
+
map(costy_eval, zip(product(uniqterms, word)))
|
28
28
|
|
29
29
|
)]
|
30
30
|
|
@@ -40,6 +40,8 @@
|
|
40
40
|
|
41
41
|
- woの順序を問わないのであればconcurrent.futuresで並列化する手もあり
|
42
42
|
|
43
|
+
- 追記:costy_evalの引数が2個なのでproductにzipを追加。mapの使い方を間違えてました。
|
44
|
+
|
43
45
|
'''
|
44
46
|
|
45
47
|
```
|