mirror of
https://github.com/explosion/spaCy.git
synced 2025-12-03 08:14:20 +03:00
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 | ||