mirror of https://github.com/explosion/spaCy.git
Merge branch 'develop' of https://github.com/explosion/spaCy into develop
This commit is contained in:
commit
96b4aef0bf
|
@ -118,8 +118,7 @@ def test_span_to_array(doc):
|
||||||
assert arr[0, 1] == len(span[0])
|
assert arr[0, 1] == len(span[0])
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail
|
|
||||||
def test_span_as_doc(doc):
|
def test_span_as_doc(doc):
|
||||||
span = doc[4:10]
|
span = doc[4:10]
|
||||||
span_doc = span.as_doc()
|
span_doc = span.as_doc()
|
||||||
assert span.text == span_doc.text
|
assert span.text == span_doc.text.strip()
|
||||||
|
|
|
@ -302,10 +302,7 @@ cdef class Token:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
if 'vector' in self.doc.user_token_hooks:
|
if 'vector' in self.doc.user_token_hooks:
|
||||||
return self.doc.user_token_hooks['vector'](self)
|
return self.doc.user_token_hooks['vector'](self)
|
||||||
if self.has_vector:
|
return self.vocab.get_vector(self.c.lex.orth)
|
||||||
return self.vocab.get_vector(self.c.lex.orth)
|
|
||||||
else:
|
|
||||||
return self.doc.tensor[self.i]
|
|
||||||
|
|
||||||
property vector_norm:
|
property vector_norm:
|
||||||
"""The L2 norm of the token's vector representation.
|
"""The L2 norm of the token's vector representation.
|
||||||
|
|
Loading…
Reference in New Issue