From 109b5e1798ddb31b52a5e7007440b13dcc942cbf Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 27 Jul 2019 15:26:01 +0200 Subject: [PATCH] Fix bug in Token.similarity when called via hook --- spacy/tokens/token.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index eb79de16b..909ebecbb 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -202,7 +202,7 @@ cdef class Token: DOCS: https://spacy.io/api/token#similarity """ if "similarity" in self.doc.user_token_hooks: - return self.doc.user_token_hooks["similarity"](self) + return self.doc.user_token_hooks["similarity"](self, other) if hasattr(other, "__len__") and len(other) == 1 and hasattr(other, "__getitem__"): if self.c.lex.orth == getattr(other[0], "orth", None): return 1.0