spaCy/spacy/matcher
Adriane Boyd 45c9a68828
Identify final Matcher pattern node by quantifier (#6317)
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.
2020-10-31 12:18:48 +01:00
..
__init__.py Dependency tree pattern matcher (#3465) 2019-06-16 13:25:32 +02:00
_schemas.py Normalize IS_SENT_START to SENT_START for Matcher (#5080) 2020-03-03 12:22:39 +01:00
dependencymatcher.pyx Bugfix/dep matcher issue 4590 (#4601) 2019-11-07 12:01:06 +01:00
matcher.pxd Identify final Matcher pattern node by quantifier (#6317) 2020-10-31 12:18:48 +01:00
matcher.pyx Identify final Matcher pattern node by quantifier (#6317) 2020-10-31 12:18:48 +01:00
phrasematcher.pxd Replace Entity/MatchStruct with SpanC (#4459) 2019-10-18 11:01:47 +02:00
phrasematcher.pyx Switch to new add API in PhraseMatcher unpickle 2020-05-25 11:22:47 +02:00