spaCy/spacy/matcher
Madeesh Kannan d1760ebe02
Better handling of unexpected types in SetPredicate (#11312)
* `Matcher`: Better type checking of values in `SetPredicate`
`SetPredicate`: Emit warning and return `False` on unexpected value types

* Rename `value_type_mismatch` variable

* Inline warning

* Remove unexpected type warning from `_SetPredicate`

* Ensure that `str` values are not interpreted as sequences
Check elements of sequence values for convertibility to `str` or `int`

* Add more `INTERSECT` and `IN` test cases

* Test for inputs with multiple characters

* Return `False` early instead of using a boolean flag

* Remove superfluous `int` check, parentheses

* Apply suggestions from code review

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>

* Appy suggestions from code review

* Clarify test comment

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
2022-09-02 09:09:48 +02:00
..
__init__.py Drop Python 2.7 and 3.5 (#4828) 2019-12-22 01:53:56 +01:00
dependencymatcher.pyi Update typing hints (#10109) 2022-01-28 16:59:54 +01:00
dependencymatcher.pyx add additional REL_OP (#10371) 2022-07-27 13:16:44 +02:00
matcher.pxd Support match alignments (#7321) 2021-04-08 18:10:14 +10:00
matcher.pyi Update typing hints (#10109) 2022-01-28 16:59:54 +01:00
matcher.pyx Better handling of unexpected types in SetPredicate (#11312) 2022-09-02 09:09:48 +02:00
phrasematcher.pxd Run PhraseMatcher on Spans (#6918) 2021-02-10 23:43:32 +11:00
phrasematcher.pyi fix(phrasematcher.pyi): change type annotation of docs in add() to List[Doc] (#10235) 2022-02-08 13:37:27 +01:00
phrasematcher.pyx Fix PhraseMatcher remove overlapping terms (#10734) 2022-05-12 12:23:52 +02:00