...
authorPierre <ratinaud@univ-tlse2.fr>
Sun, 6 Jan 2013 23:13:24 +0000 (00:13 +0100)
committerPierre <ratinaud@univ-tlse2.fr>
Sun, 6 Jan 2013 23:13:24 +0000 (00:13 +0100)
12 files changed:
ProfList.py
analysetxt.py
checkinstall.py
chemins.py
corpusNG.py
dialog.py
functions.py
guifunct.py
iramuteq.py
layout.py
openanalyse.py
textsimi.py

index 596b4e6..db822cf 100644 (file)
@@ -504,59 +504,60 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col
         DoSimi(self, param = paramsimi, fromprof = ffr(self.filename), pathout = pathout, wordgraph = word)
 
     def on_graph(self, evt):
         DoSimi(self, param = paramsimi, fromprof = ffr(self.filename), pathout = pathout, wordgraph = word)
 
     def on_graph(self, evt):
-        dlg = progressbar(self, 2)
-        corpus = self.Source.corpus
-        uces = corpus.lc[self.cl-1]
-        dlg.Update(1, u'Tableau...')
-        #tab = corpus.make_table_with_classe(uces, self.la)
-        pathout = ConstructPathOut(self.Source.pathout.dirout+'/', 'simi_classe_%i' %self.cl)
-        self.filename = os.path.join(pathout,'mat01.csv')
-        dlg.Update(2, u'Ecriture...')
-        #corpus.write_tab(tab, self.filename)
-        #del tab
-        corpus.make_and_write_sparse_matrix_from_classe(self.la, uces, self.filename)
-        dlg.Destroy()
-        paramsimi = {'coeff' : 0,
-                          'layout' : 2,
-                          'type' : 1,
-                          'arbremax' : 1,
-                          'coeff_tv' : 1,
-                          'coeff_tv_nb' : 0,
-                          'tvprop' : 0,
-                          'tvmin' : 5,
-                          'tvmax' : 30,
-                          'coeff_te' : 1,
-                          'coeff_temin' : 1,
-                          'coeff_temax' : 10,
-                          'label_v': 1,
-                          'label_e': 0,
-                          'vcex' : 0,
-                          'vcexmin' : 10,
-                          'vcexmax' : 25,
-                          'cex' : 10,
-                          'cexfromchi' : True,
-                          'sfromchi': False,
-                          'seuil_ok' : 0,
-                          'seuil' : 1,
-                          'cols' : (255,0,0),
-                          'cola' : (200,200,200),
-                          'width' : 1000,
-                          'height' : 1000,
-                          'first' : True,
-                          'keep_coord' : True,
-                          'alpha' : 20,
-                          'film': False,
-                          }
-        self.tableau = Tableau(self.parent, '')
-        self.tableau.listactives = self.la
-        self.tableau.actives = {}
-        self.tableau.lchi = self.lchi
-        self.tableau.chi = {}
-        self.tableau.parametre['fromprof'] = True
-        for i, val in enumerate(self.la) :
-            self.tableau.actives[val] = [self.lfreq[i]]
-            self.tableau.chi[val] = [self.lchi[i]]
-        DoSimi(self, param = paramsimi, fromprof = ffr(self.filename), pathout = pathout)
+        self.parent.SimiFromCluster(self.parent, self.Source.corpus, self.la, self.cl - 1, parametres = {'type' : 'clustersimitxt', 'pathout' : self.Source.parametres['pathout']}, dlg = progressbar(self, 4))
+        #dlg = progressbar(self, 2)
+        #corpus = self.Source.corpus
+        #uces = corpus.lc[self.cl-1]
+        #dlg.Update(1, u'Tableau...')
+        ##tab = corpus.make_table_with_classe(uces, self.la)
+        #pathout = ConstructPathOut(self.Source.pathout.dirout+'/', 'simi_classe_%i' %self.cl)
+        #self.filename = os.path.join(pathout,'mat01.csv')
+        #dlg.Update(2, u'Ecriture...')
+        ##corpus.write_tab(tab, self.filename)
+        ##del tab
+        #corpus.make_and_write_sparse_matrix_from_classe(self.la, uces, self.filename)
+        #dlg.Destroy()
+        #paramsimi = {'coeff' : 0,
+        #                  'layout' : 2,
+        #                  'type' : 1,
+        #                  'arbremax' : 1,
+        #                  'coeff_tv' : 1,
+        #                  'coeff_tv_nb' : 0,
+        #                  'tvprop' : 0,
+        #                  'tvmin' : 5,
+        #                  'tvmax' : 30,
+        #                  'coeff_te' : 1,
+        #                  'coeff_temin' : 1,
+        #                  'coeff_temax' : 10,
+        #                  'label_v': 1,
+        #                  'label_e': 0,
+        #                  'vcex' : 0,
+        #                  'vcexmin' : 10,
+        #                  'vcexmax' : 25,
+        #                  'cex' : 10,
+        #                  'cexfromchi' : True,
+        #                  'sfromchi': False,
+        #                  'seuil_ok' : 0,
+        #                  'seuil' : 1,
+        #                  'cols' : (255,0,0),
+        #                  'cola' : (200,200,200),
+        #                  'width' : 1000,
+        #                  'height' : 1000,
+        #                  'first' : True,
+        #                  'keep_coord' : True,
+        #                  'alpha' : 20,
+        #                  'film': False,
+        #                  }
+        #self.tableau = Tableau(self.parent, '')
+        #self.tableau.listactives = self.la
+        #self.tableau.actives = {}
+        #self.tableau.lchi = self.lchi
+        #self.tableau.chi = {}
+        #self.tableau.parametre['fromprof'] = True
+        #for i, val in enumerate(self.la) :
+        #    self.tableau.actives[val] = [self.lfreq[i]]
+        #    self.tableau.chi[val] = [self.lchi[i]]
+        #DoSimi(self, param = paramsimi, fromprof = ffr(self.filename), pathout = pathout)
 
     def on_segments(self,evt) :
         dlg = progressbar(self, 2)
 
     def on_segments(self,evt) :
         dlg = progressbar(self, 2)
index 54f0c5c..d3f8591 100644 (file)
@@ -10,7 +10,7 @@ import os
 #ALCESTE
 from PrintRScript import RchdTxt, AlcesteTxtProf
 from OptionAlceste import OptionAlc 
 #ALCESTE
 from PrintRScript import RchdTxt, AlcesteTxtProf
 from OptionAlceste import OptionAlc 
-from layout import PrintRapport
+#from layout import PrintRapport
 from openanalyse import OpenAnalyse
 from time import time
 ######################################
 from openanalyse import OpenAnalyse
 from time import time
 ######################################
@@ -53,7 +53,10 @@ class AnalyseText :
         self.dialok = True
         self.parametres = parametres
         self.val = False
         self.dialok = True
         self.parametres = parametres
         self.val = False
-        self.pathout = PathOut(corpus.parametres['originalpath'], analyse_type = parametres['type'], dirout = corpus.parametres['pathout'])
+        if not 'pathout' in self.parametres :
+            self.pathout = PathOut(corpus.parametres['originalpath'], analyse_type = parametres['type'], dirout = corpus.parametres['pathout'])
+        else :
+            self.pathout = PathOut(filename = corpus.parametres['originalpath'], dirout = self.parametres['pathout'], analyse_type = self.parametres['name'])
         self.parametres = self.make_config(parametres)
         log.info(self.pathout.dirout)
         if self.parametres is not None :
         self.parametres = self.make_config(parametres)
         log.info(self.pathout.dirout)
         if self.parametres is not None :
index 38640ed..742c15a 100644 (file)
@@ -7,7 +7,7 @@
 import os
 import sys
 import shutil
 import os
 import sys
 import shutil
-from chemins import ConstructConfigPath
+from chemins import ConstructConfigPath, ConstructDicoPath
 from functions import exec_rcode, exec_RCMD
 import wx
 import tempfile
 from functions import exec_rcode, exec_RCMD
 import wx
 import tempfile
@@ -54,6 +54,8 @@ def UpgradeConf(self) :
 def CreateIraDirectory(UserConfigPath,AppliPath):
     if not os.path.exists(UserConfigPath):
         os.mkdir(UserConfigPath)
 def CreateIraDirectory(UserConfigPath,AppliPath):
     if not os.path.exists(UserConfigPath):
         os.mkdir(UserConfigPath)
+    if not os.path.exists(os.path.join(UserConfigPath, 'dictionnaires')) :
+        os.mkdir(os.path.join(UserConfigPath, 'dictionnaires'))
 
 def CopyConf(self) :
     DictUser = self.ConfigPath
 
 def CopyConf(self) :
     DictUser = self.ConfigPath
@@ -67,6 +69,11 @@ def CopyConf(self) :
         if item == u'preferences' :
             if not os.path.exists(filein) :
                 shutil.copyfile(DictAppli[item],filein)
         if item == u'preferences' :
             if not os.path.exists(filein) :
                 shutil.copyfile(DictAppli[item],filein)
+    dicoUser = self.DictPath
+    dicoAppli = ConstructDicoPath(self.AppliPath)
+    for fi in dicoUser :
+        if not os.path.exists(dicoUser[fi]) :
+            shutil.copyfile(dicoAppli[fi], dicoUser[fi])
 
 def CheckRPath(PathPath):
     if not os.path.exists(PathPath.get('PATHS','rpath')):
 
 def CheckRPath(PathPath):
     if not os.path.exists(PathPath.get('PATHS','rpath')):
index 18ce8e8..3b3ee17 100644 (file)
@@ -117,7 +117,6 @@ def ConstructConfigPath(AppliPath, user=True):
         'path': os.path.join(ConfigPath, 'path.cfg'),
         'preferences' : os.path.join(ConfigPath, 'iramuteq.cfg'),
         'pam' : os.path.join(ConfigPath, 'pam.cfg'),
         'path': os.path.join(ConfigPath, 'path.cfg'),
         'preferences' : os.path.join(ConfigPath, 'iramuteq.cfg'),
         'pam' : os.path.join(ConfigPath, 'pam.cfg'),
-        'history' : os.path.join(ConfigPath, 'history.db'),
         'corpus' : os.path.join(ConfigPath, 'corpus.cfg'),
         'stat' : os.path.join(ConfigPath, 'stat.cfg'),
         'simitxt' : os.path.join(ConfigPath, 'simitxt.cfg'),
         'corpus' : os.path.join(ConfigPath, 'corpus.cfg'),
         'stat' : os.path.join(ConfigPath, 'stat.cfg'),
         'simitxt' : os.path.join(ConfigPath, 'simitxt.cfg'),
index cbaefa3..f6468b3 100644 (file)
@@ -163,6 +163,9 @@ class Corpus :
             lemuceeff[uce] = lemuceeff.get(uce, 0) + eff[i]
         return lemuceeff    
 
             lemuceeff[uce] = lemuceeff.get(uce, 0) + eff[i]
         return lemuceeff    
 
+    def getlemclustereff(self, lem, cluster) :
+        return len(list(set(self.lc[cluster]).intersection(self.getlemuces(lem))))
+
     def getlemeff(self, lem) :
         return self.lems[lem].freq
 
     def getlemeff(self, lem) :
         return self.lems[lem].freq
 
@@ -1220,6 +1223,9 @@ class Builder :
             ReadLexique(self.parent, lang = parametres['lang'])
             self.parent.expressions = ReadDicoAsDico(self.parent.DictPath.get(parametres['lang']+'_exp', 'french_exp'))
             self.parametres = parametres
             ReadLexique(self.parent, lang = parametres['lang'])
             self.parent.expressions = ReadDicoAsDico(self.parent.DictPath.get(parametres['lang']+'_exp', 'french_exp'))
             self.parametres = parametres
+        else :
+            if self.dlg is not None :
+                self.dlg.Destroy()
         dial.Destroy()
 
     def doanalyse(self) :
         dial.Destroy()
 
     def doanalyse(self) :
index da4eed7..2e19745 100755 (executable)
--- a/dialog.py
+++ b/dialog.py
@@ -2329,7 +2329,7 @@ class CorpusPref ( wx.Dialog ):
         fgSizer4.Add( self.check_charact, 0, wx.ALL, 5 )
         
         self.txt_charact = wx.TextCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
         fgSizer4.Add( self.check_charact, 0, wx.ALL, 5 )
         
         self.txt_charact = wx.TextCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
-        self.txt_charact.SetMinSize( wx.Size( 200,-1 ) )
+        self.txt_charact.SetMinSize( wx.Size( 400,-1 ) )
         
         fgSizer4.Add( self.txt_charact, 0, wx.ALL|wx.EXPAND, 5 )
         
         
         fgSizer4.Add( self.txt_charact, 0, wx.ALL|wx.EXPAND, 5 )
         
index 8abda95..54ead63 100644 (file)
@@ -520,6 +520,8 @@ def check_Rresult(parent, pid) :
             return False
             #except :
             #    BugReport(parent)
             return False
             #except :
             #    BugReport(parent)
+        else :
+            return None
     else :
         if pid != 0 :
             #try :
     else :
         if pid != 0 :
             #try :
@@ -527,6 +529,8 @@ def check_Rresult(parent, pid) :
             return False
             #except :
             #    BugReport(parent)
             return False
             #except :
             #    BugReport(parent)
+        else :
+            return None
 
 def print_liste(filename,liste):
     with open(filename,'w') as f :
 
 def print_liste(filename,liste):
     with open(filename,'w') as f :
index 1302fbc..ca8f66c 100644 (file)
@@ -1324,26 +1324,27 @@ class PrepSimi :
         self.dial.CenterOnParent()
         self.val = self.dial.ShowModal()
         if self.val == wx.ID_OK :
         self.dial.CenterOnParent()
         self.val = self.dial.ShowModal()
         if self.val == wx.ID_OK :
-            if self.dial.check_bystar.GetValue() :
-                variables = treat_var_mod(self.parametres['stars'])
-                vardial = dialog.OptLexi(parent) 
-                vardial.listet = self.parametres['stars']
-                vardial.variables = [v for v in variables]
-                for et in vardial.variables :
-                    vardial.list_box_1.Append(et)
-                nval = vardial.ShowModal()
-                if nval == wx.ID_OK :
-                    if vardial.choice.GetSelection() == 1 :
-                        listet = [vardial.listet[i] for i in vardial.list_box_1.GetSelections()]
-                    else :
-                        listet = variables[vardial.variables[vardial.list_box_1.GetSelections()[0]]]
-                    self.dial.Destroy()
-                    vardial.Destroy()
-                    self.etline = source.corpus.make_etline(listet)
-                    self.parametres['selectedstars'] = listet
-                    self.parametres['listet'] = self.etline
-                else:
-                    vardial.Destroy()
+            if 'bystar' in self.parametres :
+                if self.dial.check_bystar.GetValue() :
+                    variables = treat_var_mod(self.parametres['stars'])
+                    vardial = dialog.OptLexi(parent) 
+                    vardial.listet = self.parametres['stars']
+                    vardial.variables = [v for v in variables]
+                    for et in vardial.variables :
+                        vardial.list_box_1.Append(et)
+                    nval = vardial.ShowModal()
+                    if nval == wx.ID_OK :
+                        if vardial.choice.GetSelection() == 1 :
+                            listet = [vardial.listet[i] for i in vardial.list_box_1.GetSelections()]
+                        else :
+                            listet = variables[vardial.variables[vardial.list_box_1.GetSelections()[0]]]
+                        self.dial.Destroy()
+                        vardial.Destroy()
+                        self.etline = source.corpus.make_etline(listet)
+                        self.parametres['selectedstars'] = listet
+                        self.parametres['listet'] = self.etline
+                    else:
+                        vardial.Destroy()
             last = self.dial.listcol.GetFirstSelected()
             lastl = [self.dial.listcol.GetFirstSelected()]
             indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
             last = self.dial.listcol.GetFirstSelected()
             lastl = [self.dial.listcol.GetFirstSelected()]
             indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
index a5d5d9a..17d348f 100644 (file)
@@ -54,7 +54,7 @@ from analysetxt import Alceste
 from textdist import PamTxt
 from textstat import Stat
 from textaslexico import Lexico
 from textdist import PamTxt
 from textstat import Stat
 from textaslexico import Lexico
-from textsimi import SimiTxt
+from textsimi import SimiTxt, SimiFromCluster
 from textwordcloud import WordCloud
 from profile_segment import ProfileSegment
 from textcheckcorpus import checkcorpus
 from textwordcloud import WordCloud
 from profile_segment import ProfileSegment
 from textcheckcorpus import checkcorpus
@@ -149,10 +149,13 @@ class IraFrame(wx.Frame):
         self.images_path = os.path.join(AppliPath,'images')
         self.UserConfigPath = UserConfigPath
         self.RscriptsPath = ConstructRscriptsPath(AppliPath)
         self.images_path = os.path.join(AppliPath,'images')
         self.UserConfigPath = UserConfigPath
         self.RscriptsPath = ConstructRscriptsPath(AppliPath)
-        self.DictPath = ConstructDicoPath(AppliPath)
+        #self.DictPath = ConstructDicoPath(AppliPath)
+        self.DictPath = ConstructDicoPath(UserConfigPath)
         self.ConfigGlob = ConfigGlob
         self.ConfigPath = ConstructConfigPath(UserConfigPath)
         self.pref = RawConfigParser()
         self.ConfigGlob = ConfigGlob
         self.ConfigPath = ConstructConfigPath(UserConfigPath)
         self.pref = RawConfigParser()
+        #workaround for import problem
+        self.SimiFromCluster = SimiFromCluster
         #langues
         mylocale = wx.Locale(wx.LANGUAGE_FRENCH)
         mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale'))
         #langues
         mylocale = wx.Locale(wx.LANGUAGE_FRENCH)
         mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale'))
index df30cfd..9611dbb 100644 (file)
--- a/layout.py
+++ b/layout.py
@@ -10,8 +10,8 @@ import wx
 import agw.aui as aui
 from chemins import ConstructPathOut, ChdTxtPathOut, FFF, ffr, PathOut, StatTxtPathOut, simipath
 from ConfigParser import ConfigParser
 import agw.aui as aui
 from chemins import ConstructPathOut, ChdTxtPathOut, FFF, ffr, PathOut, StatTxtPathOut, simipath
 from ConfigParser import ConfigParser
-from functions import ReadProfileAsDico, GetTxtProfile, read_list_file, ReadList, exec_rcode, print_liste, BugReport, DoConf, indices_simi, check_Rresult
-from ProfList import *
+from functions import ReadProfileAsDico, GetTxtProfile, read_list_file, ReadList, exec_rcode, print_liste, BugReport, DoConf, indices_simi, check_Rresult, progressbar
+from ProfList import ProfListctrlPanel
 from guiparam3d import param3d, simi3d
 from PrintRScript import write_afc_graph, print_simi3d, PrintSimiScript
 from profile_segment import ProfileSegment
 from guiparam3d import param3d, simi3d
 from PrintRScript import write_afc_graph, print_simi3d, PrintSimiScript
 from profile_segment import ProfileSegment
index c55fef3..0c0fff7 100644 (file)
@@ -12,7 +12,7 @@ from tableau import Tableau
 import os
 import shelve
 #from ConfigParser import *
 import os
 import shelve
 #from ConfigParser import *
-from tabsimi import DoSimi
+#from tabsimi import DoSimi
 from functions import BugReport, DoConf
 import logging
 
 from functions import BugReport, DoConf
 import logging
 
@@ -98,7 +98,7 @@ class OpenAnalyse():
         elif self.conf['type'] == 'alceste' :
             self.parent.ShowMenu(_("Text analysis"))
             OpenCHDS(self.parent,  corpus, self.conf, Alceste = True)
         elif self.conf['type'] == 'alceste' :
             self.parent.ShowMenu(_("Text analysis"))
             OpenCHDS(self.parent,  corpus, self.conf, Alceste = True)
-        elif self.conf['type'] == 'simitxt' :
+        elif self.conf['type'] == 'simitxt' or self.conf['type'] == 'clustersimitxt' :
             self.parent.ShowMenu(_("Text analysis"))
             SimiLayout(self.parent, corpus, self.conf)
         elif self.conf['type'] == 'wordcloud' :
             self.parent.ShowMenu(_("Text analysis"))
             SimiLayout(self.parent, corpus, self.conf)
         elif self.conf['type'] == 'wordcloud' :
index a5b8c7b..dc75f6e 100644 (file)
@@ -1,19 +1,19 @@
 # -*- coding: utf-8 -*-
 #Author: Pierre Ratinaud
 # -*- coding: utf-8 -*-
 #Author: Pierre Ratinaud
-#Copyright (c) 2008-2011 Pierre Ratinaud
+#Copyright (c) 2008-2013 Pierre Ratinaud
 #Lisense: GNU/GPL
 
 from chemins import ffr, simipath
 #from corpus import Corpus
 import os
 from analysetxt import AnalyseText
 #Lisense: GNU/GPL
 
 from chemins import ffr, simipath
 #from corpus import Corpus
 import os
 from analysetxt import AnalyseText
-from ConfigParser import RawConfigParser
-from guifunct import getPage, getCorpus
+#from ConfigParser import RawConfigParser
+#from guifunct import getPage, getCorpus
 from dialog import StatDialog
 from guifunct import SelectColumn, PrepSimi
 from functions import indices_simi, progressbar, treat_var_mod, read_list_file, print_liste
 from dialog import StatDialog
 from guifunct import SelectColumn, PrepSimi
 from functions import indices_simi, progressbar, treat_var_mod, read_list_file, print_liste
-from tableau import Tableau
-from tabsimi import DoSimi
+#from tableau import Tableau
+#from tabsimi import DoSimi
 from PrintRScript import PrintSimiScript
 import wx
 from copy import copy
 from PrintRScript import PrintSimiScript
 import wx
 from copy import copy
@@ -115,14 +115,67 @@ class SimiTxt(AnalyseText):
         #self.actives, lim = self.corpus.make_actives_nb(self.parametres.get('max_actives',1500), 1)
         self.parametres['eff_min_forme'] = lim
         self.parametres['nbactives'] = len(self.actives)
         #self.actives, lim = self.corpus.make_actives_nb(self.parametres.get('max_actives',1500), 1)
         self.parametres['eff_min_forme'] = lim
         self.parametres['nbactives'] = len(self.actives)
-        self.parametres['fromprof'] = True
+        self.parametres['fromprof'] = False
         self.corpus.make_and_write_sparse_matrix_from_uces(self.actives, self.pathout['mat01.csv'], self.pathout['listeuce1.csv'])
         with open(self.pathout['actives.csv'], 'w') as f :
             f.write('\n'.join(self.actives).encode(self.ira.syscoding))
 
 
 
         self.corpus.make_and_write_sparse_matrix_from_uces(self.actives, self.pathout['mat01.csv'], self.pathout['listeuce1.csv'])
         with open(self.pathout['actives.csv'], 'w') as f :
             f.write('\n'.join(self.actives).encode(self.ira.syscoding))
 
 
 
+class SimiFromCluster(SimiTxt) :
+    def __init__(self, ira, corpus, actives, numcluster, parametres = None, dlg = False) :
+        self.actives = actives
+        self.numcluster = numcluster
+        parametres['name'] = 'simi_classe_%i' % (numcluster + 1)
+        SimiTxt.__init__(self, ira, corpus, parametres, dlg)
+    
+    def preferences(self) :
+        return self.parametres
+
+    def doanalyse(self) :
+        self.parametres['type'] = 'clustersimitxt'
+        self.pathout.basefiles(simipath)
+        self.indices = indices_simi
+        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
+        if self.dlg :
+            #self.listet = self.corpus.make_etoiles()
+            #self.listet.sort()
+            self.stars = []#copy(self.listet)
+            self.parametres['stars'] = False#copy(self.listet)
+            self.parametres['sfromchi'] = True
+            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.makefiles()
+            script = PrintSimiScript(self)
+            script.make_script()
+            if self.doR(script.scriptout) :
+                return False
+            if self.parametres['type_graph'] == 1:
+                if os.path.exists(self.pathout['liste_graph']):
+                    graph_simi = read_list_file(self.pathout['liste_graph'])
+                    graph_simi.append([os.path.basename(script.filename), script.txtgraph])
+                else :
+                    graph_simi = [[os.path.basename(script.filename), script.txtgraph]]
+                print_liste(self.pathout['liste_graph'], graph_simi)
+        else : 
+            return False
 
 
+    def makefiles(self) :
+        self.parametres['eff_min_forme'] = 3
+        self.parametres['nbactives'] = len(self.actives)
+        self.parametres['fromprof'] = True
+        self.corpus.make_and_write_sparse_matrix_from_classe(self.actives, self.corpus.lc[self.numcluster], self.pathout['mat01.csv'])
+        with open(self.pathout['actives.csv'], 'w') as f :
+            f.write('\n'.join(self.actives).encode(self.ira.syscoding))        
 
 #        self.tableau = Tableau(self.parent, '')
 #        self.tableau.listactives = self.actives
 
 #        self.tableau = Tableau(self.parent, '')
 #        self.tableau.listactives = self.actives