8000 Empty specs accepted by matcher.add_pattern, but cause error · Issue #588 · explosion/spaCy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Empty specs accepted by matcher.add_pattern, but cause error #588
Closed
@honnibal

Description

@honnibal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and behaviour differing from documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0