From 974e5f99028c81e9299dec9e3ef5f1af01c76023 Mon Sep 17 00:00:00 2001 From: Kevin Humphreys Date: Mon, 29 Aug 2022 15:49:15 +0200 Subject: [PATCH] case fix --- spacy/matcher/matcher.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/matcher/matcher.pyx b/spacy/matcher/matcher.pyx index 7a098aac2..54481258b 100644 --- a/spacy/matcher/matcher.pyx +++ b/spacy/matcher/matcher.pyx @@ -1048,6 +1048,7 @@ def _get_extra_predicates_dict(attr, value_dict, vocab, fuzzy, fuzzy_match, predicate_types, extra_predicates, seen_predicates): output = [] for type_, value in value_dict.items(): + type_ = type_.upper() if type_ == 'FUZZY': fuzzy_match = True # explicit fuzzy match if isinstance(value, dict): @@ -1056,10 +1057,10 @@ def _get_extra_predicates_dict(attr, value_dict, vocab, fuzzy, fuzzy_match, predicate_types, extra_predicates, seen_predicates)) continue - cls = predicate_types.get(type_.upper()) + cls = predicate_types.get(type_) if cls is None: warnings.warn(Warnings.W035.format(pattern=value_dict)) - # ignore unrecongized predicate type + # ignore unrecognized predicate type continue predicate = cls(len(extra_predicates), attr, value, type_, vocab=vocab, fuzzy=fuzzy if fuzzy_match else 0)