mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
45c9a68828
Modify the internal pattern representation in `Matcher` patterns to identify the final ID state using a unique quantifier rather than a combination of other attributes. It was insufficient to identify the final ID node based on an uninitialized `quantifier` (coincidentally being the same as the `ZERO`) with `nr_attr` as 0. (In addition, it was potentially bug-prone that `nr_attr` was set to 0 even though attrs were allocated.) In the case of `{"OP": "!"}` (a valid, if pointless, pattern), `nr_attr` is 0 and the quantifier is ZERO, so the previous methods for incrementing to the ID node at the end of the pattern weren't able to distinguish the final ID node from the `{"OP": "!"}` pattern. |
||
---|---|---|
.. | ||
__init__.py | ||
_schemas.py | ||
dependencymatcher.pyx | ||
matcher.pxd | ||
matcher.pyx | ||
phrasematcher.pxd | ||
phrasematcher.pyx |