X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=textwordcloud.py;h=8022af6ff130e30cb6ddd4bd9b55bc1758769794;hp=01ccf9ac6e4d93ac61b5f9a0e0a026f5d1485d1d;hb=3d64c267454b7f21a33b58af45459d1f66d43241;hpb=a503f041dc4947ee21c1d353ddd05ddb13a5e322 diff --git a/textwordcloud.py b/textwordcloud.py index 01ccf9a..8022af6 100644 --- a/textwordcloud.py +++ b/textwordcloud.py @@ -10,13 +10,11 @@ from ConfigParser import RawConfigParser from functions import sortedby, progressbar, CreateIraFile, exec_rcode, check_Rresult, MessageImage from dialog import StatDialog, PrefWordCloud from PrintRScript import WordCloudRScript -#from openanalyse import OpenAnalyse #from ttparser import * import tempfile from time import sleep import wx import os -#from corpusNG import Corpus import logging logger = logging.getLogger('iramuteq.textwordcloud') @@ -27,15 +25,16 @@ class WordCloud(AnalyseText): self.parametres['type'] = 'wordcloud' #FIXME limit = 3 - mode = 'both' - if mode == 'both' : + self.make_option() + if self.parametres['mode'] == 2 : self.actives = self.corpus.make_actives_limit(limit, 1) self.actives += self.corpus.make_actives_limit(limit, 2) - elif mode == 'act' : + elif self.parametres['mode'] == 0 : self.actives = self.corpus.make_actives_limit(limit, 1) + elif self.parametres['mode'] == 1 : + self.actives = self.corpus.make_actives_limit(limit, 2) dictcol = dict([[i, [act, self.corpus.getlemeff(act)]] for i, act in enumerate(self.actives)]) - SelectColumn(self.ira, dictcol, self.actives, self.pathout['selected.csv']) - self.make_option() + SelectColumn(self.ira, dictcol, self.actives, self.pathout['selected.csv'], dlg = True) self.make_wordcloud() script = WordCloudRScript(self) script.make_script() @@ -48,12 +47,12 @@ class WordCloud(AnalyseText): if res == wx.ID_OK : self.parametres['width'] = dial.spin_L.GetValue() self.parametres['height'] = dial.spin_H.GetValue() - #maxword = dial.spin_maxword.GetValue() self.parametres['maxword'] = dial.spin_maxword.GetValue() self.parametres['mincex'] = float(dial.spin_mincex.GetValue())/float(10) self.parametres['maxcex'] = float(dial.spin_maxcex.GetValue())/float(10) self.parametres['col_text'] = dial.color_text.GetColour() self.parametres['col_bg'] = dial.color_bg.GetColour() + self.parametres['mode'] = dial.typeformeschoice.GetSelection() outgraph = os.path.join(os.path.dirname(self.pathout['zipf.png']), 'nuage_') nb = 1 while os.path.exists(outgraph + str(nb) + '.png') :