X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=textwordcloud.py;h=9e358720ce16bc0018386eaccce9b17a4de92635;hp=b56d16d3d73d5a32db8900c64783bcb3bc9679ce;hb=81594f689f1e191599d96a2a503fbb5529df69d7;hpb=44b2ba75167b1ed5508e2f110130805bfe43a3bd diff --git a/textwordcloud.py b/textwordcloud.py index b56d16d..9e35872 100644 --- a/textwordcloud.py +++ b/textwordcloud.py @@ -4,13 +4,12 @@ #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 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 @@ -41,24 +40,24 @@ class WordCloud(AnalyseText): dial.CenterOnParent() res = dial.ShowModal() if res == wx.ID_OK : - self.parametres['width'] = pref.spin_L.GetValue() - self.parametres['height'] = pref.spin_H.GetValue() - #maxword = pref.spin_maxword.GetValue() - self.parametres['mincex'] = float(pref.spin_mincex.GetValue())/float(10) - self.parametres['maxcex'] = float(pref.spin_maxcex.GetValue())/float(10) - self.parametres['col_text'] = pref.color_text.GetColour() - self.parametres['col_bg'] = pref.color_bg.GetColour() + self.parametres['width'] = dial.spin_L.GetValue() + self.parametres['height'] = dial.spin_H.GetValue() + #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() outgraph = os.path.join(os.path.dirname(self.pathout['zipf.png']), 'nuage_') nb = 1 while os.path.exists(outgraph + str(nb) + '.png') : nb += 1 - self.parametres['outgraph'] = outgraph + str(nb) + '.png' + self.parametres['graphout'] = outgraph + str(nb) + '.png' def make_wordcloud(self) : - act = [[act, self.corpus.getlemeff(act)] for act in self.actives] + 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('\t'.join([[val[0], `val[1]`] for val in act]))) + f.write('\n'.join(act).encode(self.ira.syscoding)) #################################################################### # self.conf = None # self.parent = parent