Skip to content

Commit

Permalink
Test Issue #587: Matcher segfaults on particular input
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Oct 28, 2016
1 parent 46ddfa8 commit 782e481
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spacy/tests/regression/test_issue587.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import spacy
import spacy.matcher

import pytest

@pytest.mark.models
def test_matcher_segfault():
nlp = spacy.load('en', parser=False, entity=False)
matcher = spacy.matcher.Matcher(nlp.vocab)
content = u'''a b; c'''
matcher.add(entity_key='1', label='TEST', attrs={}, specs=[[{65: 'a'}, {65: 'b'}]])
matcher(nlp(content))
matcher.add(entity_key='2', label='TEST', attrs={}, specs=[[{65: 'a'}, {65: 'b'}, {5: True}, {65: 'c'}]])
matcher(nlp(content))
matcher.add(entity_key='3', label='TEST', attrs={}, specs=[[{65: 'a'}, {65: 'b'}, {5: True}, {65: 'd'}]])
matcher(nlp(content))

0 comments on commit 782e481

Please sign in to comment.