spaCy/spacy/matcher
Paul O'Leary McCann 2a7e327310
Fix Dependency Matcher Ordering Issue (#9337)
* Fix inconsistency

This makes the failing test pass, so that behavior is consistent whether
patterns are added in one call or two.

The issue is that the hash for patterns depended on the index of the
pattern in the list of current patterns, not the list of total patterns,
so a second call would get identical match ids.

* Add illustrative test case

* Add failing test for remove case

Patterns are not removed from the internal matcher on calls to remove,
which causes spurious weird matches (or misses).

* Fix removal issue

Remove patterns from the internal matcher.

* Check that the single add call also gets no matches
2021-10-11 10:26:13 +02:00
..
__init__.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
dependencymatcher.pyx Fix Dependency Matcher Ordering Issue (#9337) 2021-10-11 10:26:13 +02:00
matcher.pxd Support match alignments (#7321) 2021-04-08 18:10:14 +10:00
matcher.pyi Add stub files for main cython classes (#8427) 2021-08-07 12:30:03 +02:00
matcher.pyx Pass alignments to Matcher callbacks (#9001) 2021-09-02 12:58:05 +02:00
phrasematcher.pxd Run PhraseMatcher on Spans (#6918) 2021-02-10 23:43:32 +11:00
phrasematcher.pyx Don't add duplicate patterns all the time in EntityRuler (fix #8216) (#8246) 2021-06-03 09:05:26 +02:00