Skip to content

Commit e237b69

Browse files
Bug fix on the documentation
1 parent 86d7e15 commit e237b69

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎docs/source/index.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ particularly egregious:
7878
>>> nlp = spacy.en.English()
7979
>>> tokens = nlp("‘Give it back,’ he pleaded abjectly, ‘it’s mine.’",
8080
tag=True, parse=False)
81-
>>> print(''.join(tok.string.upper() if tok.pos == ADV else tok.string) for t in tokens)
81+
>>> print(''.join(tok.string.upper() if tok.pos == ADV else tok.string for tok in tokens))
8282
‘Give it BACK,’ he pleaded ABJECTLY, ‘it’s mine.’
8383

8484

@@ -144,7 +144,7 @@ cosine metric:
144144
>>> from numpy import dot
145145
>>> from numpy.linalg import norm
146146
>>> cosine = lambda v1, v2: dot(v1, v2) / (norm(v1), norm(v2))
147-
>>> words = [w for w in nlp.vocab if w.is_lower]
147+
>>> words = [w for w in nlp.vocab if w.lower]
148148
>>> words.sort(key=lambda w: cosine(w, pleaded))
149149
>>> words.reverse()
150150
>>> print('1-20', ', '.join(w.orth_ for w in words[0:20]))

0 commit comments

Comments
 (0)