ucis_txt, ucestxt = doconcorde(corpus, nuces, page.la, uci = uci)
items = ['<br>'.join([ucis_txt[j], '<table bgcolor = #1BF0F7 border=0><tr><td><b>score : %.2f</b></td></tr></table><br>' % ntab2[j][0], ucestxt[j]]) for j, uce in enumerate(nuces)]
filename = self.page.pathout['st_caract_cl_%i.html' % (rcl+1)]
- with open(filename, 'w') as f :
+ with open(filename, 'w', encoding='utf8') as f :
f.write('\n'.join(items))
dlg.Destroy()
uci = False
fileout = os.path.join(os.path.dirname(self.page.pathout['ira']), 'segmented_corpus.txt')
txt = self.page.corpus.make_cut_corpus(uci = uci)
- with open(fileout, 'w') as f :
+ with open(fileout, 'w', encoding='utf8') as f :
f.write(txt)
msg = '\n'.join([_("Done !"), fileout])
dlg = wx.MessageDialog(self.parent, msg, _("Segmented corpus"), wx.OK | wx.ICON_INFORMATION)
else :
uci = True
txt = self.page.corpus.make_colored_corpus(uci = uci)
- with open(fileout, 'w') as f :
+ with open(fileout, 'w', encoding='utf8') as f :
f.write(txt)
msg = ' !\n'.join([_("Done"), _("Open in a web browser ?")])
dlg = wx.MessageDialog(self.parent, msg, "Corpus en couleur", wx.NO | wx.YES | wx.ICON_QUESTION)
find = True
break
if not find :
- open_antiprofil(self.page, self.page.dictpathout['ANTIPRO_OUT'], self.parent.syscoding)
+ open_antiprofil(self.page, self.page.dictpathout['ANTIPRO_OUT'], 'utf8')
self.page.TabChdSim.SetSelection(self.page.TabChdSim.GetPageCount() - 1)
def OnTranslate(self, evt) :
if res == wx.ID_OK :
fileout = dial.fbb.GetValue()
dial.Destroy()
- with open(fileout, 'w') as f :
+ with open(fileout, 'w', encoding='utf8') as f :
f.write(self.page.debtext + '\n' + GetTxtProfile(self.page.DictProfile, self.page.cluster_size))
msg = "Fini !"
dlg = wx.MessageDialog(self.parent, msg, _("Report"), wx.OK | wx.ICON_INFORMATION)
pydata = self.GetPyData(item)
if pydata is not None :
if 'corpus_name' in pydata or 'corpus' in pydata :
- self.ira.ShowMenu('matrix', False)
+ #self.ira.ShowMenu('matrix', False)
self.ira.ShowMenu('text', True)
if 'matrix_name' in pydata or 'matrix' in pydata:
- self.ira.ShowMenu('text', False)
+ #self.ira.ShowMenu('text', False)
self.ira.ShowMenu('matrix', True)
if 'uuid' in pydata :
if pydata['uuid'] in ['textroot', 'matroot'] :
self.ira.ShowMenu('matrix', False)
self.pydata = pydata
if pydata['uuid'] in self.parent.history.opened :
+ actual = self.parent.nb.GetSelection()
for i in range(self.parent.nb.GetPageCount()) :
self.page = self.parent.nb.GetPage(i)
if 'parametres' in dir(self.page) :
if self.page.parametres['uuid'] == pydata['uuid'] :
self.parent.nb.SetSelection(i)
+ wx.CallAfter(self.parent.nb.SendSizeEvent)
+ #self.parent.Refresh()
break
- if event is not None :
- event.Skip()
+ #self.parent._mgr.Update()
+ #if event is not None :
+ # event.Skip()
def OnSelChanging(self, event):
item = event.GetItem()
else:
olditemtext = self.GetItemText(olditem)
#self.log.info("OnSelChanging: From %s" % olditemtext + " To %s" % self.GetItemText(item) + "\n")
- event.Skip()
+ #event.Skip()
def OnBeginDrag(self, event):
self.item = event.GetItem()