Skip to content

Commit

Permalink
Add regression test for issue #3541
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Jul 11, 2019
1 parent a388888 commit 1510d3b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spacy/tests/regression/test_issue3541.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding: utf8
from __future__ import unicode_literals

import pytest
from spacy.tokens import Doc
from spacy.matcher import Matcher

@pytest.mark.xfail
def test_issue3541(en_vocab):
doc = Doc(en_vocab, words=["terrific", "group", "of", "people"])
# Works
m1 = Matcher(doc.vocab)
m1.add("PAT", None, [{'LOWER' : "terrific"}, {"OP": "?"}, {'LOWER' : "group"}])
m2 = Matcher(doc.vocab)
m2.add("PAT", None, [{'LOWER' : "terrific"}, {"OP": "?"}, {"OP": "?"}, {'LOWER' : "group"}])
matches1 = m1(doc)
assert matches1 == [(doc.vocab.strings["PAT"], 0, 2)]
matches2 = m2(doc)
assert matches2 == [(doc.vocab.strings["PAT"], 0, 2)]

0 comments on commit 1510d3b

Please sign in to comment.