From a8c7144718828c3f7745c054d1e16c100734d9d5 Mon Sep 17 00:00:00 2001 From: Pierre Ratinaud Date: Tue, 25 Nov 2014 22:45:41 +0100 Subject: [PATCH] ... --- ProfList.py | 30 ++++-------------------------- tree.py | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/ProfList.py b/ProfList.py index c220171..7308f43 100644 --- a/ProfList.py +++ b/ProfList.py @@ -617,7 +617,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col 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, uce in enumerate(nuces)]) dlg.Update(4, u'texte...') - win = message(self, items, u"Segments de texte caractéristiques - Classe %i" % self.cl, (750, 600)) + win = message(self, items, u"Segments de texte caractéristiques - Classe %i" % self.cl, (750, 600), uceids = nuces) #win.html = '\n' + '
'.join(['
'.join([ucis_txt[i], '
score : %.2f
' % ntab2[i][0], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n' #win.HtmlPage.SetPage(win.html) dlg.Destroy() @@ -641,28 +641,6 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col nbcl = len(title) nbwords = len(words) BarFrame(self.Source.parent, tableout, title, words) -# txt = barplot(tableout, words, title, self.Source.parent.RscriptsPath['Rgraph'], tmpgraph) -# #print 'ATTENTION TEST R' -# #txt = """ -# #sink('/Users/pierre/Desktop/qdfqsdfqsdfqsdf.txt') -# #Sys.getlocale() -# #sink() -# #""" -# tmpscript = tempfile.mktemp(dir=self.Source.parent.TEMPDIR) -# file = open(tmpscript,'w') -# file.write(txt) -# file.close() -# exec_rcode(self.Source.parent.RPath, tmpscript, wait = True) -# w = 100 + (20 * nbwords) + (100 * nbcl) -# h = 100 + (nbwords * 15) -# if w > 1100 : w = 1100 -# if h > 800 : h = 800 -# if h < 450 : h = 450 -# win = MessageImage(self, u"Graphique", size=(w, h)) -# win.addsaveimage(tmpgraph) -# txt = "" % tmpgraph -# win.HtmlPage.SetPage(txt) -# win.Show(True) def onlexdendro(self, evt): if 'corpus' in dir(self.Source): @@ -698,7 +676,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col uci = True ucis_txt, ucestxt = doconcorde(corpus, ucef, ListWord, uci = uci) items = dict([[i, '

'.join([ucis_txt[i], ucestxt[i]])] for i in range(0,len(ucestxt))]) - win = message(self, items, title, (800, 500)) + win = message(self, items, title, (800, 500), uceids = ucef) return win def OnPopupTwo(self, event): @@ -711,13 +689,13 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col def OnPopupThree(self, event): corpus = self.Source.corpus uces = [classe[i] for classe in corpus.lc for i in range(0,len(classe))] - win = self.make_concord(uces, "Concordancier - UCE classées") + win = self.make_concord(uces, "Concordancier - Segments de texte classés") win.Show(True) def OnPopupFour(self, event): corpus = self.Source.corpus uces = [classe[i] for classe in corpus.lc for i in range(0,len(classe))] + corpus.lc0 - win = self.make_concord(uces, "Concordancier - Toutes les UCE") + win = self.make_concord(uces, "Concordancier - Tous les segments de texte") win.Show(True) def OnPopupFive(self, event): diff --git a/tree.py b/tree.py index 6d0945f..3d8196c 100644 --- a/tree.py +++ b/tree.py @@ -18,6 +18,7 @@ from dialog import PrefSimpleFile, PrefExport from layout import open_antiprofil, TgenLayout from guifunct import TGenFrame from textaslexico import TgenSpec +from textreinert import TgenProf log = logging.getLogger('iramuteq.tree') @@ -143,7 +144,7 @@ class LeftTree(CT.CustomTreeCtrl): self.SetItemImage(self.root, 24, CT.TreeItemIcon_Normal) self.SetItemImage(self.root, 13, CT.TreeItemIcon_Expanded) - self.textroot = self.AppendItem(self.root, u'Corpus texte') + self.textroot = self.AppendItem(self.root, _(u'Textual corpus')) self.SetPyData(self.textroot, {'uuid': 'textroot'}) self.SetItemImage(self.textroot, imgtextroot, CT.TreeItemIcon_Normal) self.SetItemImage(self.textroot, imgtextroot, CT.TreeItemIcon_Expanded) @@ -165,7 +166,7 @@ class LeftTree(CT.CustomTreeCtrl): self.SetItemImage(last, img, CT.TreeItemIcon_Normal) self.SetItemImage(last, img, CT.TreeItemIcon_Expanded) - self.matroot = self.AppendItem(self.root, u'Matrices') + self.matroot = self.AppendItem(self.root, _(u'Matrix')) self.SetPyData(self.matroot, {'uuid': 'matroot'}) self.SetItemImage(self.matroot, imgmatroot, CT.TreeItemIcon_Normal) self.SetItemImage(self.matroot, imgmatroot, CT.TreeItemIcon_Expanded) @@ -445,6 +446,8 @@ class LeftTree(CT.CustomTreeCtrl): profsr = menu.Append(wx.ID_ANY, _(u"Repeated segments profiles").decode('utf8')) profgram = menu.Append(wx.ID_ANY, _(u"POS profiles").decode('utf8')) + tgen = menu.Append(wx.ID_ANY, _(u"Tgen Editor").decode('utf8')) + computetgen = menu.Append(wx.ID_ANY, _(u"Compute Tgen").decode('utf8')) export_corpus = menu.Append(wx.ID_ANY, _(u"Export corpus").decode('utf8')) colored = menu.Append(wx.ID_ANY, _(u"Colored corpus").decode('utf8')) navig = menu.Append(wx.ID_ANY, _(u"Navigator").decode('utf8')) @@ -456,6 +459,8 @@ class LeftTree(CT.CustomTreeCtrl): self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro) self.Bind(wx.EVT_MENU, self.OnProfSR, profsr) self.Bind(wx.EVT_MENU, self.OnProfGram, profgram) + self.Bind(wx.EVT_MENU, self.OnTgenEditor, tgen) + self.Bind(wx.EVT_MENU, self.OnTgenCompute, computetgen) self.Bind(wx.EVT_MENU, self.OnExportCorpus, export_corpus) self.Bind(wx.EVT_MENU, self.OnColored, colored) self.Bind(wx.EVT_MENU, self.OnNavig, navig) @@ -718,8 +723,11 @@ class LeftTree(CT.CustomTreeCtrl): else : self.page.parametres['tgenpath'] = tgenpath tgen = TGen(path = tgenpath, encoding = self.parent.syscoding) - self.page.parametres['etoiles'] = self.page.etoiles - TgenSpec(self.parent, corpus, self.page.parametres) + if self.page.parametres['type'] == 'spec' : + self.page.parametres['etoiles'] = self.page.etoiles + TgenSpec(self.parent, corpus, self.page.parametres) + elif self.page.parametres['type'] == 'alceste' : + TgenProf(self.parent, corpus, self.page.parametres, self.page.cluster_size) TgenLayout(self.page) def OnExportClasses(self, event): -- 2.7.4