8000 removed itertools import · killix/stanford-corenlp-python@5235f07 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5235f07

Browse files
committed
removed itertools import
1 parent 089ce96 commit 5235f07

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

corenlp.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import os
1515
import time
1616
import re
17-
from itertools import ifilterfalse
1817

1918
import pexpect
2019

@@ -199,8 +198,8 @@ def parse_imperative(self, text):
199198
result = self._parse(text)
200199
if result[0].has_key('text'):
201200
result[0]['text'] = text
202-
result[0]['tuples'] = ifilterfalse(lambda x: x[1] == used_pronoun or x[2]
203-
== used_pronoun, result[0]['tuples'])
201+
result[0]['tuples'] = filter(lambda x: not (x[1] == used_pronoun or x[2]
202+
== used_pronoun), result[0]['tuples'])
204203
del result[0]['words'][used_pronoun]
205204
return dumps(result)
206205
else:

0 commit comments

Comments
 (0)
0