Skip to content

Commit

Permalink
Add regression test for #3972
Browse files Browse the repository at this point in the history
  • Loading branch information
ines committed Jul 16, 2019
1 parent 0883b07 commit 7f55105
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spacy/tests/regression/test_issue3972.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding: utf8
from __future__ import unicode_literals

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


@pytest.mark.xfail
def test_issue3972(en_vocab):
"""Test that the PhraseMatcher returns duplicates for duplicate match IDs.
"""
matcher = PhraseMatcher(en_vocab)
matcher.add("A", None, Doc(en_vocab, words=["New", "York"]))
matcher.add("B", None, Doc(en_vocab, words=["New", "York"]))
doc = Doc(en_vocab, words=["I", "live", "in", "New", "York"])
matches = matcher(doc)
assert len(matches) == 2

0 comments on commit 7f55105

Please sign in to comment.