mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Fix JSON encoding issue on load
This commit is contained in:
parent
b5a74f8ad2
commit
2e92c6fb3a
|
@ -28,7 +28,7 @@ class Lemmatizer(object):
|
|||
exc[pos] = read_exc(file_)
|
||||
else:
|
||||
exc[pos] = {}
|
||||
with (path / 'vocab' / 'lemma_rules.json').open('rb') as file_:
|
||||
with (path / 'vocab' / 'lemma_rules.json').open('r', encoding='utf8') as file_:
|
||||
rules = json.load(file_)
|
||||
return cls(index, exc, rules)
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ cdef class Matcher:
|
|||
@classmethod
|
||||
def load(cls, path, vocab):
|
||||
if (path / 'gazetteer.json').exists():
|
||||
with (path / 'gazetteer.json').open('rb') as file_:
|
||||
with (path / 'gazetteer.json').open('r', encoding='utf8') as file_:
|
||||
patterns = json.load(file_)
|
||||
else:
|
||||
patterns = {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user