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

Matcher.remove crashes if {"OP": "!"} token is in any pattern of any rule #6148

Closed
delzac opened this issue Sep 25, 2020 · 2 comments · Fixed by #6317
Closed

Matcher.remove crashes if {"OP": "!"} token is in any pattern of any rule #6148

delzac opened this issue Sep 25, 2020 · 2 comments · Fixed by #6317
Labels
bug Bugs and behaviour differing from documentation feat / matcher Feature: Token, phrase and dependency matcher

Comments

@delzac
Copy link
Contributor

delzac commented Sep 25, 2020

How to reproduce the behaviour

nlp = en_core_web_sm.load()
matcher = Matcher(nlp.vocab)

offending_pattern = [{'OP': '!'}, ]
matcher.add('test-rule', [offending_pattern ])
matcher.add('random-rule', [[{"LOWER": "hi"}]])
assert 'random-rule' in matcher
matcher.remove('random-rule')  # crashes here: "Process finished with exit code -1073741819 (0xC0000005)"
assert 'random-rule' not in matcher

When {"OP": "!"} is inside any pattern, removing any rules will result in program crashing "Process finished with exit code -1073741819 (0xC0000005)"

Your Environment

  • Operating System: Windows 10
  • Python Version Used: Python 3.6
  • spaCy Version Used: Spacy v2.3.2
  • Environment Information: nil
@adrianeboyd adrianeboyd added bug Bugs and behaviour differing from documentation feat / matcher Feature: Token, phrase and dependency matcher labels Sep 25, 2020
@delzac delzac changed the title Matcher.remove crashes if {"OP": "!"} token is inside the pattern of rule being removed Matcher.remove crashes if {"OP": "!"} token is any pattern of any rule Sep 26, 2020
@delzac delzac changed the title Matcher.remove crashes if {"OP": "!"} token is any pattern of any rule Matcher.remove crashes if {"OP": "!"} token is in any pattern of any rule Sep 26, 2020
@adrianeboyd
Copy link
Contributor

Hi, I can replicate this and we will look into it.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2021
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 feat / matcher Feature: Token, phrase and dependency matcher
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants