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, '<br>'.join([ucis_txt[i], '<table bgcolor = #1BF0F7 border=0><tr><td><b>score : %.2f</b></td></tr></table><br>' % ntab2[i][0], ucestxt[i]])] for i in range(0,len(ucestxt))])
+ items = dict([[uce[1], '<br>'.join([ucis_txt[uce[1]], '<table bgcolor = #1BF0F7 border=0><tr><td><b>score : %.2f</b></td></tr></table><br>' % 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 = '<html>\n' + '<br>'.join(['<br>'.join([ucis_txt[i], '<table bgcolor = #1BF0F7 border=0><tr><td><b>score : %.2f</b></td></tr></table>' % ntab2[i][0], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n</html>'
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]
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 = [' ', '']
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)