+ def doanalyse(self) :
+ self.parametres['type'] = 'clustersimitxt'
+ self.pathout.basefiles(simipath)
+ self.indices = indices_simi
+ if self.dlg :
+ self.makesimiparam()
+ if 'bystar' in self.parametres :
+ del self.parametres['bystar']
+ dictcol = dict([[i, [act, self.corpus.getlemclustereff(act, self.numcluster)]] for i, act in enumerate(self.actives)])
+ continu = True
+ #print self.dlg
+ if self.dlg :
+ self.dlg.Destroy()
+ self.stars = []#copy(self.listet)
+ self.parametres['stars'] = 0#copy(self.listet)
+ self.parametres['sfromchi'] = 1
+ prep = PrepSimi(self.ira, self, self.parametres, self.pathout['selected.csv'], self.actives, indices_simi, wordlist=dictcol)
+ if prep.val == wx.ID_OK :
+ continu = True
+ self.parametres = prep.parametres
+ else :
+ continu = False
+ if continu :
+ self.dlg = progressbar(self.parent, 3)
+ self.makefiles()
+ self.parametres['type'] = 'clustersimitxt'
+ script = PrintSimiScript(self)
+ script.make_script()
+ if not self.doR(script.scriptout, dlg = self.dlg, message = 'R ...') :
+ return False
+ if self.parametres['type_graph'] == 1:
+ if self.parametres['svg'] :
+ filename, ext = os.path.splitext(script.filename)
+ fileout = filename + '.svg'
+ else :
+ fileout = script.filename
+ if os.path.exists(self.pathout['liste_graph']):
+ graph_simi = read_list_file(self.pathout['liste_graph'])
+ graph_simi.append([os.path.basename(fileout), script.txtgraph])
+ else :
+ graph_simi = [[os.path.basename(fileout), script.txtgraph]]
+ print_liste(self.pathout['liste_graph'], graph_simi)
+ else :
+ return False