mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
* Fix test_base_nps
This commit is contained in:
parent
2ef449f9d7
commit
c26b4b4650
|
@ -31,10 +31,10 @@ def test_pp(EN):
|
||||||
@pytest.mark.models
|
@pytest.mark.models
|
||||||
def test_merge_pp(EN):
|
def test_merge_pp(EN):
|
||||||
sent = EN(u'A phrase with another phrase occurs')
|
sent = EN(u'A phrase with another phrase occurs')
|
||||||
nps = [(np[0].idx, np[-1].idx + len(np[-1]), np[0].ent_type_) for np in sent.noun_chunks]
|
nps = [(np[0].idx, np[-1].idx + len(np[-1]), np.lemma_, np[0].ent_type_) for np in sent.noun_chunks]
|
||||||
|
|
||||||
for start, end, ent_type in nps:
|
for start, end, lemma, ent_type in nps:
|
||||||
sent.merge(start, end, u'NP', np.lemma_, ent_type)
|
sent.merge(start, end, u'NP', lemma, ent_type)
|
||||||
assert sent[0].string == 'A phrase '
|
assert sent[0].string == 'A phrase '
|
||||||
assert sent[1].string == 'with '
|
assert sent[1].string == 'with '
|
||||||
assert sent[2].string == 'another phrase '
|
assert sent[2].string == 'another phrase '
|
||||||
|
|
Loading…
Reference in New Issue
Block a user