...
[iramuteq] / textwordcloud.py
index b31e940..01ccf9a 100644 (file)
@@ -4,8 +4,6 @@
 #Copyright (c) 2008-2009 Pierre Ratinaud
 #Lisense: GNU/GPL
 
 #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
 from analysetxt import AnalyseText
 from guifunct import getPage, getCorpus, SelectColumn
 from ConfigParser import RawConfigParser
@@ -28,7 +26,13 @@ class WordCloud(AnalyseText):
     def doanalyse(self) :
         self.parametres['type'] = 'wordcloud'
         #FIXME
     def doanalyse(self) :
         self.parametres['type'] = 'wordcloud'
         #FIXME
-        self.actives = self.corpus.make_actives_limit(3)        
+        limit = 3
+        mode = 'both'
+        if mode == 'both' :
+            self.actives = self.corpus.make_actives_limit(limit, 1)
+            self.actives += self.corpus.make_actives_limit(limit, 2)
+        elif mode == 'act' :
+            self.actives = self.corpus.make_actives_limit(limit, 1)
         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()
         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()
@@ -45,6 +49,7 @@ class WordCloud(AnalyseText):
             self.parametres['width'] = dial.spin_L.GetValue()
             self.parametres['height'] = dial.spin_H.GetValue()
             #maxword = dial.spin_maxword.GetValue()
             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['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()