mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Update regression test
This commit is contained in:
parent
5c3ff06924
commit
99e44fbdbb
|
@ -9,11 +9,14 @@ import pytest
|
||||||
@pytest.mark.models('en')
|
@pytest.mark.models('en')
|
||||||
def test_issue429(EN):
|
def test_issue429(EN):
|
||||||
def merge_phrases(matcher, doc, i, matches):
|
def merge_phrases(matcher, doc, i, matches):
|
||||||
if i != len(matches) - 1:
|
if i != len(matches) - 1:
|
||||||
return None
|
return None
|
||||||
spans = [(ent_id, ent_id, doc[start:end]) for ent_id, start, end in matches]
|
spans = [(ent_id, ent_id, doc[start:end]) for ent_id, start, end in matches]
|
||||||
for ent_id, label, span in spans:
|
for ent_id, label, span in spans:
|
||||||
span.merge('NNP' if label else span.root.tag_, span.text, EN.vocab.strings[label])
|
span.merge(
|
||||||
|
tag=('NNP' if label else span.root.tag_),
|
||||||
|
lemma=span.text,
|
||||||
|
label='PERSON')
|
||||||
|
|
||||||
doc = EN('a')
|
doc = EN('a')
|
||||||
matcher = Matcher(EN.vocab)
|
matcher = Matcher(EN.vocab)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user