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

Missing comparison predicate handling for != in Matcher #5281

Closed
paoloq opened this issue Apr 9, 2020 · 2 comments
Closed

Missing comparison predicate handling for != in Matcher #5281

paoloq opened this issue Apr 9, 2020 · 2 comments
Labels
enhancement Feature requests and improvements feat / matcher Feature: Token, phrase and dependency matcher

Comments

@paoloq
Copy link
Contributor

paoloq commented Apr 9, 2020

How to reproduce the behaviour

import spacy
nlp = spacy.load("en_core_web_sm")
matcher = Matcher(nlp.vocab)
pattern = [{"LENGTH": {"!=": 2}}]
matcher.add("LENGTH_COMPARE", [pattern])
doc = Doc(nlp.vocab, words=["a", "aa", "aaa"])
matches = matcher(doc)
assert len(matches) == 2

Your Environment

  • spaCy version: 2.2.4
  • Platform: Linux-4.19.0-6-amd64-x86_64-with-glibc2.28
  • Python version: 3.8.1
paoloq added a commit to erre-quadro/spaCy that referenced this issue Apr 9, 2020
@svlandeg svlandeg added enhancement Feature requests and improvements feat / matcher Feature: Token, phrase and dependency matcher labels Apr 9, 2020
@lock
Copy link

lock bot commented May 20, 2020

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.

1 similar comment
@lock
Copy link

lock bot commented May 20, 2020

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 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Feature requests and improvements feat / matcher Feature: Token, phrase and dependency matcher
Projects
None yet
Development

No branches or pull requests

2 participants