2019-04-09 09:07:14 +00:00
|
|
|
import pytest
|
|
|
|
from spacy.tokens import Doc, Token
|
|
|
|
from spacy.matcher import Matcher
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.xfail
|
|
|
|
def test_issue3555(en_vocab):
|
|
|
|
"""Test that custom extensions with default None don't break matcher."""
|
|
|
|
Token.set_extension("issue3555", default=None)
|
|
|
|
matcher = Matcher(en_vocab)
|
|
|
|
pattern = [{"LEMMA": "have"}, {"_": {"issue3555": True}}]
|
2019-10-25 20:21:08 +00:00
|
|
|
matcher.add("TEST", [pattern])
|
2019-04-09 09:07:14 +00:00
|
|
|
doc = Doc(en_vocab, words=["have", "apple"])
|
|
|
|
matcher(doc)
|