fix(analyzer): skip SpacyRecognizer for SlimSpacyNlpEngine#2168
Open
ultramancode wants to merge 4 commits into
Open
fix(analyzer): skip SpacyRecognizer for SlimSpacyNlpEngine#2168ultramancode wants to merge 4 commits into
ultramancode wants to merge 4 commits into
Conversation
omri374
reviewed
Jul 16, 2026
omri374
reviewed
Jul 16, 2026
Contributor
Author
|
Thanks for the review! I've updated the PR based on your suggestions. The capability-based approach made the implementation cleaner and easier to maintain. |
omri374
reviewed
Jul 17, 2026
| @property | ||
| def has_ner(self) -> bool: | ||
| """Returns True if this engine performs Named Entity Recognition natively.""" | ||
| return False |
Collaborator
There was a problem hiding this comment.
This is a breaking change. If someone has a custom nlp engine, it might stop working if this property is set to False. Better to keep it always True and False for the no-op and slim engines
Contributor
Author
There was a problem hiding this comment.
Thanks! has_ner now defaults to True, while SlimSpacyNlpEngine and NoOpNlpEngine explicitly return False. Tests and documentation have been updated accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
SlimSpacyNlpEnginedisables NER, but the recognizer registry treated it like a regular spaCy engine and addedSpacyRecognizer.When
SpacyRecognizerreceived an empty supported-entities list from the slim engine, it fell back to its default entities. As a result, the registry reported NER entities that the slim engine could not produce.When
SlimSpacyNlpEngineis used, the registry no longer addsSpacyRecognizerautomatically.If
SpacyRecognizeris explicitly configured, analyzer initialization fails because the slim engine does not produce the NER results it requires.This does not affect tokenization, lemmatization, or context-based score enhancement provided by the slim engine.
Checklist