diff --git a/spacy/tests/regression/test_issue429.py b/spacy/tests/regression/test_issue429.py index 1baa9a1db..74f12bd9f 100644 --- a/spacy/tests/regression/test_issue429.py +++ b/spacy/tests/regression/test_issue429.py @@ -9,11 +9,14 @@ import pytest @pytest.mark.models('en') def test_issue429(EN): def merge_phrases(matcher, doc, i, matches): - if i != len(matches) - 1: - return None - spans = [(ent_id, ent_id, doc[start:end]) for ent_id, start, end in matches] - for ent_id, label, span in spans: - span.merge('NNP' if label else span.root.tag_, span.text, EN.vocab.strings[label]) + if i != len(matches) - 1: + return None + spans = [(ent_id, ent_id, doc[start:end]) for ent_id, start, end in matches] + for ent_id, label, span in spans: + span.merge( + tag=('NNP' if label else span.root.tag_), + lemma=span.text, + label='PERSON') doc = EN('a') matcher = Matcher(EN.vocab)