Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty specs accepted by matcher.add_pattern, but cause error #588

Closed
honnibal opened this issue Oct 28, 2016 · 1 comment
Closed

Empty specs accepted by matcher.add_pattern, but cause error #588

honnibal opened this issue Oct 28, 2016 · 1 comment
Labels
bug Bugs and behaviour differing from documentation

Comments

@honnibal
Copy link
Member

From Issue #429:

import spacy
import spacy.matcher

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=[[]])
matcher(nlp(content))
->

Traceback (most recent call last): 
  File "word2vec/matcher_bla.py", line 8, in <module>
    matcher(nlp(content))
  File "spacy/matcher.pyx", line 315, in spacy.matcher.Matcher.__call__ (spacy/matcher.cpp:8519)
Exception: Error selecting action in matcher

Caused by empty specs. While I understand that this is a mistake in my data it's better to check this when entity is being added.

@honnibal honnibal added the bug Bugs and behaviour differing from documentation label Oct 28, 2016
@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation
Projects
None yet
Development

No branches or pull requests

1 participant