Skip to content

Commit b7e9dde

Browse files
authored
quickfix syntax / typo (nltk#3215)
* fix typo / syntax error * refactor comparison to None * format file with black to pass pre-commit checks
1 parent 30fefc9 commit b7e9dde

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

nltk/chat/eliza.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,10 @@ def eliza_chat():
328328

329329
eliza_chatbot.converse()
330330

331+
331332
def demo():
332333
eliza_chat()
333334

335+
334336
if __name__ == "__main__":
335337
eliza_chat()

nltk/metrics/aline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ def delta(p, q):
12211221
"""
12221222
features = R(p, q)
12231223
total = 0
1224-
if np != None:
1224+
if np is not None:
12251225
return np.dot(
12261226
[diff(p, q, f) for f in features], [salience[f] for f in features]
12271227
)

nltk/metrics/confusionmatrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def key(self):
197197
str = "Value key:\n"
198198
indexlen = len(repr(len(values) - 1))
199199
key_format = " %" + repr(indexlen) + "d: %s\n"
200-
str += str += "".join([key_format % (i, values[i]) for i in range(len(values))])
200+
str += "".join([key_format % (i, values[i]) for i in range(len(values))])
201201
return str
202202

203203
def recall(self, value):

0 commit comments

Comments
 (0)