X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=textwordcloud.py;h=199d4a66a316b937478ba0ce182c6d2569ea9545;hp=b31e94050a13cdff7d60c98098933401f1fef187;hb=1fb687c23b19ae4cc88146acf393041356c1df3a;hpb=c5650ea708101e654d8851350494c0e9a712b6ed diff --git a/textwordcloud.py b/textwordcloud.py index b31e940..199d4a6 100644 --- a/textwordcloud.py +++ b/textwordcloud.py @@ -4,8 +4,6 @@ #Copyright (c) 2008-2009 Pierre Ratinaud #Lisense: GNU/GPL -from chemins import ConstructPathOut, StatTxtPathOut, ffr, FFF -#from corpus import Corpus from analysetxt import AnalyseText from guifunct import getPage, getCorpus, SelectColumn from ConfigParser import RawConfigParser @@ -28,10 +26,17 @@ class WordCloud(AnalyseText): def doanalyse(self) : self.parametres['type'] = 'wordcloud' #FIXME - self.actives = self.corpus.make_actives_limit(3) - 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']) + limit = 3 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 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'], dlg = True) self.make_wordcloud() script = WordCloudRScript(self) script.make_script() @@ -44,11 +49,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') :