From e84160b7f61eb5b05cc12339e44a61d67b499e15 Mon Sep 17 00:00:00 2001 From: Pierre Ratinaud Date: Mon, 8 Sep 2014 22:21:47 +0200 Subject: [PATCH] correction segments caracteristiques --- ProfList.py | 3 ++- corpus.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ProfList.py b/ProfList.py index 8c30c72..09ba0b4 100644 --- a/ProfList.py +++ b/ProfList.py @@ -599,9 +599,10 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col ntab2.sort(reverse = True) ntab2 = ntab2[:limite] nuces = [val[1] for val in ntab2] + orderuce = [[uce, i] for i, uce in enumerate(nuces)] dlg.Update(3, u'concordancier...') ucis_txt, ucestxt = doconcorde(corpus, nuces, self.la, uci = uci) - items = dict([[i, '
'.join([ucis_txt[i], '
score : %.2f

' % ntab2[i][0], ucestxt[i]])] for i in range(0,len(ucestxt))]) + items = dict([[uce[1], '
'.join([ucis_txt[uce[1]], '
score : %.2f

' % ntab2[uce[1]][0], ucestxt[uce[1]]])] for uce in orderuce]) dlg.Update(4, u'texte...') win = message(self, items, u"Segments de texte caractéristiques - Classe %i" % self.cl, (750, 600)) #win.html = '\n' + '
'.join(['
'.join([ucis_txt[i], '
score : %.2f
' % ntab2[i][0], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n' diff --git a/corpus.py b/corpus.py index 42b3d72..cbf8794 100644 --- a/corpus.py +++ b/corpus.py @@ -214,7 +214,7 @@ class Corpus : return [len(uce[1].split()) for uce in res] def getconcorde(self, uces) : - return self.cuces.execute('select * from uces where id IN (%s);' % ', '.join([`i` for i in uces])) + return self.cuces.execute('select * from uces where id IN (%s) ORDER BY id;' % ', '.join([`i` for i in uces])) def getuciconcorde(self, ucis) : uces = [[val,[uce.ident for uce in self.ucis[val].uces]] for val in ucis] @@ -1130,7 +1130,7 @@ class BuildCorpus : self.corpus.pathout = PathOut(filename = parametres_corpus['originalpath'], dirout = parametres_corpus['pathout']) self.corpus.pathout.createdir(parametres_corpus['pathout']) self.corpus.parametres['uuid'] = str(uuid4()) - self.corpus.parametres['corpus_name'] = os.path.split(self.corpus.parametres['pathout'])[1] + self.corpus.parametres['corpus_name'] = parametres_corpus['corpus_name']#os.path.split(self.corpus.parametres['pathout'])[1] self.corpus.parametres['type'] = 'corpus' if self.corpus.parametres['keep_ponct'] : self.ponctuation_espace = [' ', ''] @@ -1490,6 +1490,7 @@ class Builder : self.dlg = dlg parametres = DoConf(os.path.join(self.parent.UserConfigPath,'corpus.cfg')).getoptions('corpus') parametres['pathout'] = PathOut(parent.filename, 'corpus').mkdirout() + parametres['corpus_name'] = os.path.split(parametres['pathout'])[1] dial = CorpusPref(parent, parametres) dial.CenterOnParent() dial.txtpath.SetLabel(parent.filename) -- 2.7.4