spaCy/spacy/tests/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 Revert #4334 2019-09-29 17:32:12 +02:00
test_dependency_matcher.py Fix Dependency Matcher Ordering Issue (#9337) 2021-10-11 10:26:13 +02:00
test_matcher_api.py Pass alignments to Matcher callbacks (#9001) 2021-09-02 12:58:05 +02:00
test_matcher_logic.py Tidy up code 2021-06-28 12:08:15 +02:00
test_pattern_validation.py Fix tests 2020-09-04 14:05:55 +02:00
test_phrase_matcher.py Tidy up and auto-format 2021-02-13 12:55:56 +11:00