X-Git-Url: http://www.iramuteq.org/git?a=blobdiff_plain;f=textwordcloud.py;fp=textwordcloud.py;h=aa669eb25fc0bed66c0baafada147b4343b32e23;hb=e6f6318b1ab077a97c10559b3323ccf158ae6203;hp=d8b6adaa5719c18852fa9952fee9fd1437fdbab1;hpb=971de797b3c5602affd200633161ba87576b93f5;p=iramuteq diff --git a/textwordcloud.py b/textwordcloud.py index d8b6ada..aa669eb 100644 --- a/textwordcloud.py +++ b/textwordcloud.py @@ -95,7 +95,7 @@ class WordCloud(AnalyseText): def make_wordcloud(self) : act = ['\t'.join([act, repr(self.corpus.getlemeff(act))]) for act in self.actives] - with open(self.pathout['actives_eff.csv'], 'w') as f : + with open(self.pathout['actives_eff.csv'], 'w', encoding='utf8') as f : f.write('\n'.join(act)) @@ -115,7 +115,7 @@ class ClusterCloud(WordCloud): else: tokeep = 2 prof = [[val[0], int(round(val[tokeep]))] for val in prof] - with open(self.pathout['actives_eff.csv'], 'w') as f : + with open(self.pathout['actives_eff.csv'], 'w', encoding='utf8') as f : f.write('\n'.join(['\t'.join([val[0], repr(val[1])]) for val in prof])) dictcol = dict([[i, val] for i, val in enumerate(prof)]) self.actives = [val[0] for val in prof]