nlp = spacy.load("en")
doc1 = nlp(u"I am here")
doc2 = nlp(u"Hello")
doc1[0] == doc2[0]
True
In the above snippet, spacy is treating 1st token of both the docs as equal. So, in the below source code the __richcmp__ method it is using index to compare.
def __richcmp__(self, Token other, int op):
# http://cython.readthedocs.io/en/latest/src/userguide/special_methods.html
my = self.idx
their = other.idx if other is not None else None
Thanks, this must've been in there a long time. If you want to submit a patch for this, the best solution would be to check that other.doc is self
Fixed :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Fixed :)