mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 09:44:36 +03:00
* Set heads for test_merge_tokens, to make the test run without models
This commit is contained in:
parent
c107da9738
commit
cc4c335e14
|
@ -1,9 +1,12 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
from spacy.attrs import HEAD
|
||||||
import pytest
|
import pytest
|
||||||
|
import numpy
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.models
|
|
||||||
def test_merge_tokens(EN):
|
def test_merge_tokens(EN):
|
||||||
tokens = EN(u'Los Angeles start.')
|
tokens = EN(u'Los Angeles start.')
|
||||||
|
tokens.from_array([HEAD], numpy.asarray([[1, 1, 0, -1]], dtype='int32').T)
|
||||||
assert len(tokens) == 4
|
assert len(tokens) == 4
|
||||||
assert tokens[0].head.orth_ == 'Angeles'
|
assert tokens[0].head.orth_ == 'Angeles'
|
||||||
assert tokens[1].head.orth_ == 'start'
|
assert tokens[1].head.orth_ == 'start'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user