From c208eb6e4d26ae874a84dd4485bd809599748552 Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Fri, 6 Dec 2019 19:22:57 +0100 Subject: [PATCH] Fix int value handling in Matcher (#4749) Add `int` values (for `LENGTH`) in _get_attr_values() instead of treating `int` like `dict`. --- spacy/matcher/matcher.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/matcher/matcher.pyx b/spacy/matcher/matcher.pyx index 6f6848102..30ef3dd36 100644 --- a/spacy/matcher/matcher.pyx +++ b/spacy/matcher/matcher.pyx @@ -677,7 +677,9 @@ def _get_attr_values(spec, string_store): value = string_store.add(value) elif isinstance(value, bool): value = int(value) - elif isinstance(value, (dict, int)): + elif isinstance(value, int): + pass + elif isinstance(value, dict): continue else: raise ValueError(Errors.E153.format(vtype=type(value).__name__))