diff --git a/spacy/matcher.pyx b/spacy/matcher.pyx index 842820b58..ba4b46fad 100644 --- a/spacy/matcher.pyx +++ b/spacy/matcher.pyx @@ -172,9 +172,9 @@ cdef class Matcher: @classmethod def load(cls, pkg_or_str_or_file, Vocab vocab): package = Package.create_or_return(pkg_or_str_or_file) - patterns = package.load_utf8(json.load, - 'vocab', 'gazetteer.json', - default={}) # TODO: really optional? + + with package.open(('vocab', 'serializer.json'), default=None) as file_: + patterns = json.load(file_) if file_ is not None else {} return cls(vocab, patterns) def __init__(self, vocab, patterns):