spaCy/spacy/tests/regression
Matthew Honnibal 174e85439b
Fix behaviour of Matcher's ? quantifier for v2.1 (#3105)
* Add failing test for matcher bug #3009

* Deduplicate matches from Matcher

* Update matcher ? quantifier test

* Fix bug with ? quantifier in Matcher

The ? quantifier indicates a token may occur zero or one times. If the
token pattern fit, the matcher would fail to consider valid matches
where the token pattern did not fit. Consider a simple regex like:

.?b

If we have the string 'b', the .? part will fit --- but then the 'b' in
the pattern will not fit, leaving us with no match. The same bug left us
with too few matches in some cases. For instance, consider:

.?.?

If we have a string of length two, like 'ab', we actually have three
possible matches here: [a, b, ab]. We were only recovering 'ab'. This
should now be fixed. Note that the fix also uncovered another bug, where
we weren't deduplicating the matches. There are actually two ways we
might match 'a' and two ways we might match 'b': as the second token of the pattern,
or as the first token of the pattern. This ambiguity is spurious, so we
need to deduplicate.

Closes #2464 and #3009

* Fix Python2
2018-12-29 16:18:09 +01:00
..
__init__.py Add __init__.py file for regression tests 2016-11-01 13:45:06 +01:00
_test_issue1622.py Don't run weird failing test for now 2018-11-30 16:13:40 +01:00
_test_issue2800.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue1-1000.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue1001-1500.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue1501-2000.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2001-2500.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2564.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2569.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2626.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2671.py Tidy up and format remaining files 2018-11-30 17:43:08 +01:00
test_issue2754.py Make NORM a token attribute (#3029) 2018-12-08 10:49:10 +01:00
test_issue2772.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2782.py 💫 Tidy up and auto-format tests (#2967) 2018-11-27 01:09:36 +01:00
test_issue2871.py Add test for issue #2871 -- vectors for reserved words 2018-12-10 16:09:10 +01:00
test_issue2901.py Fix the first nlp call for ja (closes #2901) (#3065) 2018-12-18 15:01:06 +01:00
test_issue3009.py Fix behaviour of Matcher's ? quantifier for v2.1 (#3105) 2018-12-29 16:18:09 +01:00
test_issue3012.py issue #3012: add test (#3021) 2018-12-18 15:02:49 +01:00