Fix JSON encoding issue on load

This commit is contained in:
Matthew Honnibal 2016-10-20 21:06:48 +02:00
parent b5a74f8ad2
commit 2e92c6fb3a
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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 = {}