From 1a93d7f725d7ca2131942f748a9953dbac8ed026 Mon Sep 17 00:00:00 2001 From: Yaser Martinez Palenzuela Date: Tue, 1 Mar 2016 14:10:11 +0100 Subject: [PATCH] replace codecs.open with io.open --- bin/get_freqs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/get_freqs.py b/bin/get_freqs.py index c26af34be..54d90ef8c 100755 --- a/bin/get_freqs.py +++ b/bin/get_freqs.py @@ -8,7 +8,6 @@ from os import path import os import bz2 import ujson -import codecs from preshed.counter import PreshCounter from joblib import Parallel, delayed import io @@ -37,7 +36,7 @@ def count_freqs(input_loc, output_loc): doc = tokenizer(json_comment['body']) doc.count_by(ORTH, counts=counts) - with codecs.open(output_loc, 'w', 'utf8') as file_: + with io.open(output_loc, 'w', 'utf8') as file_: for orth, freq in counts: string = tokenizer.vocab.strings[orth] if not string.isspace():