mirror of https://github.com/explosion/spaCy.git
* Fix spans/test_merge.py
This commit is contained in:
parent
8a4c9c33f1
commit
9abb0dd4fd
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
|
||||||
def test_merge_tokens(en_nlp):
|
def test_merge_tokens(EN):
|
||||||
tokens = en_nlp(u'Los Angeles start.')
|
tokens = en_nlp(u'Los Angeles start.')
|
||||||
assert len(tokens) == 4
|
assert len(tokens) == 4
|
||||||
assert tokens[0].head.orth_ == 'Angeles'
|
assert tokens[0].head.orth_ == 'Angeles'
|
||||||
|
@ -12,7 +12,7 @@ def test_merge_tokens(en_nlp):
|
||||||
assert tokens[0].head.orth_ == 'start'
|
assert tokens[0].head.orth_ == 'start'
|
||||||
|
|
||||||
|
|
||||||
def test_merge_heads(en_nlp):
|
def test_merge_heads(EN):
|
||||||
tokens = en_nlp(u'I found a pilates class near work.')
|
tokens = en_nlp(u'I found a pilates class near work.')
|
||||||
assert len(tokens) == 8
|
assert len(tokens) == 8
|
||||||
tokens.merge(tokens[3].idx, tokens[4].idx + len(tokens[4]), tokens[4].tag_,
|
tokens.merge(tokens[3].idx, tokens[4].idx + len(tokens[4]), tokens[4].tag_,
|
||||||
|
|
Loading…
Reference in New Issue