10000 ifilterfalse import · rocipher/stanford-corenlp-python@089ce96 · GitHub
[go: up one dir, main page]

Skip to content

Commit 089ce96

Browse files
committed
ifilterfalse import
1 parent a635864 commit 089ce96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

corenlp.py

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

1819
import pexpect
1920

@@ -198,7 +199,7 @@ def parse_imperative(self, text):
198199
result = self._parse(text)
199200
if result[0].has_key('text'):
200201
result[0]['text'] = text
201-
result[0]['tuples'] = ifilter(lambda x: x[1] == used_pronoun or x[2]
202+
result[0]['tuples'] = ifilterfalse(lambda x: x[1] == used_pronoun or x[2]
202203
== used_pronoun, result[0]['tuples'])
203204
del result[0]['words'][used_pronoun]
204205
return dumps(result)

0 commit comments

Comments
 (0)
0