X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=ProfList.py;h=b64d633e6916079a3bfac3fc92aad90f91500b70;hp=d6050c62caf0e14a15d10de492439048d1143a55;hb=1af1cc70c4cefced20d259b7ca9f8d1e250a5d3b;hpb=437f0dd98164afb134c221fe4c4378ec7e3b64e5
diff --git a/ProfList.py b/ProfList.py
index d6050c6..b64d633 100644
--- a/ProfList.py
+++ b/ProfList.py
@@ -27,7 +27,7 @@ import webbrowser
#import cStringIO
import tempfile
import codecs
-from functions import exec_rcode, MessageImage, progressbar, treat_var_mod
+from functions import exec_rcode, MessageImage, progressbar, treat_var_mod, doconcorde
from PrintRScript import barplot
from textclassechd import ClasseCHD
from shutil import copyfile
@@ -358,7 +358,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col
parametres['clusterprof'] = prof
parametres['type'] = 'clustercloud'
parametres['prof'] = self.Source.pathout['actprof_classe_%i.csv' % self.cl]
- print parametres['prof']
+ del parametres['uuid']
#if not os.path.exists(self.Source.pathout['actprof_classe_%i.csv' % self.lc]) :
# with open(self.Source.pathout['actprof_classe_%i.csv' % self.lc], 'w') as f :
# f.write('\n'.join(prof).encode(self.parent.syscoding))
@@ -431,6 +431,10 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col
def quest_simi(self, evt) :
tableau = self.Source.tableau
+ if self.tmpchi is None :
+ self.tmpchi = tempfile.mktemp(dir=self.Source.parent.TEMPDIR)
+ with open(self.tmpchi, 'w') as f:
+ f.write('\n'.join([str(val) for val in self.lchi]))
tab = tableau.make_table_from_classe(self.cl, self.la)
pathout = ConstructPathOut(self.Source.pathout.dirout, 'simi_classe_%i' %self.cl)
self.filename = os.path.join(pathout,'mat01.csv')
@@ -468,7 +472,8 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col
'film': False,
'com' : 0,
'communities' : 0,
- 'halo' : 0
+ 'halo' : 0,
+ 'tmpchi': self.tmpchi
}
act = {}
tableau.chi = {}
@@ -553,24 +558,10 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col
ntab2 = ntab2[:limite]
nuces = [val[1] for val in ntab2]
dlg.Update(3, u'concordancier...')
- #ucestxt = [corpus.ucis_paras_uces[val[1][0]][val[1][1]][val[1][2]] for val in ntab2]
- ucestxt1 = [row for row in corpus.getconcorde(nuces)]
- ucestxt = []
- ucis_txt = []
- for uce in ucestxt1 :
- ucetxt = ' '+uce[1]+' '
- ucis_txt.append(' '.join(corpus.ucis[corpus.getucefromid(uce[0]).uci].etoiles) + '
')
- for lem in self.la :
- listmot = corpus.getlems()[lem].formes
- for id in listmot :
- forme = corpus.getforme(id).forme
- ucetxt = ucetxt.replace(' '+forme+' ', ' ' + forme + ' ')
- ucestxt.append(ucetxt)
- #ucestxt = [corpus.make_concord(self.la, ' '.join(uce), 'red') for uce in ucestxt]
+ ucis_txt, ucestxt = doconcorde(corpus, nuces, self.la)
dlg.Update(4, u'texte...')
- #ucis_txt = [' '.join(corpus.ucis[val[1][0]][0]) for val in ntab2]
win = message(self, u"Segments de texte caractéristiques - Classe %i" % self.cl, (750, 600))
- win.html = '\n' + '
'.join(['
'.join([ucis_txt[i], 'score : ' + str(ntab2[i][0]), ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n'
+ win.html = '\n' + '
'.join(['
'.join([ucis_txt[i], '
score : %.2f |