From f07e4accd79871a39f969a081c945b70b0d14e02 Mon Sep 17 00:00:00 2001 From: maxirmx Date: Wed, 21 Oct 2015 20:45:56 +0300 Subject: [PATCH] Fixing encoding issue #4 --- spacy/lemmatizer.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spacy/lemmatizer.py b/spacy/lemmatizer.py index 3eb7d1a52..08e511f68 100644 --- a/spacy/lemmatizer.py +++ b/spacy/lemmatizer.py @@ -19,10 +19,7 @@ class Lemmatizer(object): index[pos] = read_index(path.join(data_dir, 'wordnet', 'index.%s' % pos)) exc[pos] = read_exc(path.join(data_dir, 'wordnet', '%s.exc' % pos)) if path.exists(path.join(data_dir, 'vocab', 'lemma_rules.json')): - if sys.version_info[0] == 3: - rules = json.load(open(path.join(data_dir, 'vocab', 'lemma_rules.json'), encoding="utf_8")) - else: - rules = json.load(open(path.join(data_dir, 'vocab', 'lemma_rules.json'))) + rules = json.load(codecs.open(path.join(data_dir, 'vocab', 'lemma_rules.json'), encoding='utf_8')) else: rules = {} return cls(index, exc, rules)