mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Fix encoding when opening files in Python 2.7, re Issue #539
This commit is contained in:
parent
339b56eb1f
commit
f189a3cb00
|
@ -28,7 +28,7 @@ class Lemmatizer(object):
|
||||||
exc[pos] = read_exc(file_)
|
exc[pos] = read_exc(file_)
|
||||||
else:
|
else:
|
||||||
exc[pos] = {}
|
exc[pos] = {}
|
||||||
with (path / 'vocab' / 'lemma_rules.json').open() as file_:
|
with (path / 'vocab' / 'lemma_rules.json').open('rb') as file_:
|
||||||
rules = json.load(file_)
|
rules = json.load(file_)
|
||||||
return cls(index, exc, rules)
|
return cls(index, exc, rules)
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ cdef class Matcher:
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, path, vocab):
|
def load(cls, path, vocab):
|
||||||
if (path / 'gazetteer.json').exists():
|
if (path / 'gazetteer.json').exists():
|
||||||
with (path / 'gazetteer.json').open() as file_:
|
with (path / 'gazetteer.json').open('rb') as file_:
|
||||||
patterns = json.load(file_)
|
patterns = json.load(file_)
|
||||||
else:
|
else:
|
||||||
patterns = {}
|
patterns = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user