                  return 1.0
          if self.vocab.vectors.n_keys == 0:
              warnings.warn(Warnings.W007.format(obj="Token"))
          if self.vector_norm == 0 or other.vector_norm == 0:
              warnings.warn(Warnings.W008.format(obj="Token"))
              return 0.0
          vector = self.vector
          xp = get_array_module(vector)
          result = xp.dot(vector, other.vector) / (self.vector_norm * other.vector_norm)
          # ensure we get a scalar back (numpy does this automatically but cupy doesn't)
 
</s> remove             warnings.warn(Warnings.W008.format(obj="Doc"))
 </s> add             if not self.has_vector or not other.has_vector:
                warnings.warn(Warnings.W008.format(obj="Doc")) </s> remove             warnings.warn(Warnings.W008.format(obj="Span"))
 </s> add             if not self.has_vector or not other.has_vector:
                warnings.warn(Warnings.W008.format(obj="Span")) </s> remove     with pytest.warns(UserWarning):
        assert doc[0:2].similarity(doc[1:3]) == doc[1:3].similarity(doc[0:2])
        assert -1.0 < doc[0:2].similarity(doc[1:3]) < 1.0
 </s> add     assert doc[0:2].similarity(doc[1:3]) == doc[1:3].similarity(doc[0:2])
    assert -1.0 < doc[0:2].similarity(doc[1:3]) < 1.0 </s> remove     with pytest.warns(UserWarning):
        assert isinstance(doc[:2].similarity(doc[0]), float)
        assert isinstance(doc[0].similarity(doc[-2]), float)
        assert doc[:2].similarity(doc[0]) == doc[0].similarity(doc[:2])
 </s> add     assert isinstance(doc[:2].similarity(doc[0]), float)
    assert isinstance(doc[0].similarity(doc[:2]), float)
    assert doc[:2].similarity(doc[0]) == doc[0].similarity(doc[:2]) </s> remove     with pytest.warns(UserWarning):
        assert isinstance(doc.similarity(doc[0]), float)
        assert isinstance(doc[0].similarity(doc), float)
        assert doc.similarity(doc[0]) == doc[0].similarity(doc)
 </s> add     assert isinstance(doc.similarity(doc[0]), float)
    assert isinstance(doc[0].similarity(doc), float)
    assert doc.similarity(doc[0]) == doc[0].similarity(doc)
            if not self.has_vector or not other.has_vector:
                warnings.warn(Warnings.W008.format(obj="Token"))
                  return 1.0
          if self.vocab.vectors.n_keys == 0:
              warnings.warn(Warnings.W007.format(obj="Token"))
          if self.vector_norm == 0 or other.vector_norm == 0:
            if not self.has_vector or not other.has_vector:
                warnings.warn(Warnings.W008.format(obj="Token"))
              return 0.0
          vector = self.vector
          xp = get_array_module(vector)
          result = xp.dot(vector, other.vector) / (self.vector_norm * other.vector_norm)
          # ensure we get a scalar back (numpy does this automatically but cupy doesn't)
keep keep keep keep replace keep keep keep keep keep
 Update vector handling in similarity methods (#11013)

Distinguish between vectors that are 0 vs. missing vectors when warning
about missing vectors.

Update `Doc.has_vector` to match `Span.has_vector` and
`Token.has_vector` for cases where the vocab has vectors but none of the
tokens in the container have vectors. 
spacy/tokens/token.pyx