From f714c0db3a64366fadb788f15967eb138df033c1 Mon Sep 17 00:00:00 2001 From: zwiebelslayer <48961608+zwiebelslayer@users.noreply.github.com> Date: Sun, 6 Apr 2025 19:44:40 +0200 Subject: [PATCH] fixed UnicodeDecodeError Specify encoding, to load json file properly --- pylats/lats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylats/lats.py b/pylats/lats.py index 485ae7e..1119fcf 100644 --- a/pylats/lats.py +++ b/pylats/lats.py @@ -35,7 +35,7 @@ def get_fname(packagename,filename): #look in package, then in local working dir return(filename) en_rwl = pickle.load(open(get_fname('pylats',"real_words5.pickle"),"rb")) #words in written COCA that occur at least 5 times -es_rwl = json.load(open(get_fname('pylats',"corp_raw_freq_escow_ax01_2021-04-28_5.json"))) +es_rwl = json.load(open(get_fname('pylats',"corp_raw_freq_escow_ax01_2021-04-28_5.json"), "r", encoding="utf-8")) en_10kpos = pickle.load(open(get_fname('pylats',"10k_pos_noes.pickle"),"rb")) #words in COCA that are within the most frequent 10k en_10kraw = pickle.load(open(get_fname('pylats',"10k_raw_noes.pickle"),"rb")) #words in COCA that are within the most frequent 10k cedel_ignore = pickle.load(open(get_fname('pylats',"cedel_ignore.pickle"),"rb")) #words in the CEDEL L2 Spanish (L1 English) corpus that should be ignored but were not caught by other filters