X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=textwordcloud.py;fp=textwordcloud.py;h=908ba89c60ab565b43d9069afaf82eaf4d4d1eaa;hp=ed4c1cfb4685a8ed8c105347aa8b30e89eca4317;hb=437f0dd98164afb134c221fe4c4378ec7e3b64e5;hpb=2d70912896c621bb627ec61c65481949fa693526 diff --git a/textwordcloud.py b/textwordcloud.py index ed4c1cf..908ba89 100644 --- a/textwordcloud.py +++ b/textwordcloud.py @@ -77,3 +77,29 @@ class WordCloud(AnalyseText): act = ['\t'.join([act, `self.corpus.getlemeff(act)`]) for act in self.actives] with open(self.pathout['actives_eff.csv'], 'w') as f : f.write('\n'.join(act).encode(self.ira.syscoding)) + + +class ClusterCloud(WordCloud) : + def doanalyse(self) : + self.parametres['type'] = 'clustercloud' + #FIXME + limit = 2 + res = self.make_option() + if res == wx.ID_OK : + prof = self.parametres['clusterprof'] + del self.parametres['clusterprof'] + if self.parametres.get('unit', 0) == 0 : + tokeep = 1 + else : + tokeep = 2 + prof = [[val[0], int(round(val[tokeep]))] for val in prof] + with open(self.pathout['actives_eff.csv'], 'w') as f : + f.write('\n'.join(['\t'.join([val[0], `val[1]`]) for val in prof]).encode(self.ira.syscoding)) + dictcol = dict([[i, val] for i, val in enumerate(prof)]) + self.actives = [val[0] for val in prof] + SelectColumn(self.ira, dictcol, self.actives, self.pathout['selected.csv'], dlg = True) + script = WordCloudRScript(self) + script.make_script() + self.doR(script.scriptout, dlg = self.dlg, message = 'R...') + else : + return 'NOK'