spaCy/spacy/tests/regression/test_issue758.py

17 lines
467 B
Python
Raw Normal View History

2017-04-24 08:09:01 +00:00
from __future__ import unicode_literals
from ... import load as load_spacy
from ...attrs import LEMMA
from ...matcher import merge_phrase
import pytest
@pytest.mark.models
def test_issue758():
'''Test parser transition bug after label added.'''
nlp = load_spacy('en')
nlp.matcher.add('splash', 'my_entity', {},
[[{LEMMA: 'splash'}, {LEMMA: 'on'}]],
on_match=merge_phrase)
2017-03-31 11:59:32 +00:00
doc = nlp('splash On', parse=False)