X-Git-Url: http://iramuteq.org/git?a=blobdiff_plain;ds=sidebyside;f=listlex.py;h=285745aa7d31dadbb5292be6f0b9e45b98cbba15;hb=9ae220065c6a29fa4fa4f24a3269631e902c228d;hp=dea3c98d5bbe07974c988c6a2b136e986d8dc8bb;hpb=3647a911117ea08f4f969720a16c58bcc7d4e809;p=iramuteq
diff --git a/listlex.py b/listlex.py
index dea3c98..285745a 100644
--- a/listlex.py
+++ b/listlex.py
@@ -16,12 +16,11 @@ import os
import sys
import wx
import wx.lib.mixins.listctrl as listmix
-import cStringIO
import tempfile
from functions import exec_rcode, doconcorde
from chemins import ffr
from PrintRScript import barplot
-from dialog import SearchDial, message, BarGraphDialog, MessageImage, BarFrame
+from dialog import SearchDial, message, BarGraphDialog, BarFrame
from operator import itemgetter
#---------------------------------------------------------------------------
@@ -34,6 +33,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor
self.dlist=dlist
self.first = first
self.tgen = False
+ self.tgenlem = False
if 'etoiles' in dir(self.gparent) and not usefirst :
self.etoiles = self.gparent.etoiles
else :
@@ -74,8 +74,8 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor
self.SetColumnWidth(0, 180)
- for i in range(0,len(self.first)):
- self.SetColumnWidth(i + 1, self.checkcolumnwidth(len(self.first[i]) * 10))
+ for i in range(0,len(self.etoiles)):
+ self.SetColumnWidth(i + 1, self.checkcolumnwidth(len(self.etoiles[i]) * 10))
self.itemDataMap = self.dlist
self.itemIndexMap = self.dlist.keys()
@@ -185,30 +185,33 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor
self.popup_Tgen_glob = wx.NewId()
self.onmaketgen = wx.NewId()
self.ID_stcaract = wx.NewId()
+ self.id_tgendetails = wx.NewId()
- self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1)
- self.Bind(wx.EVT_MENU, self.OnPopupTwo, id=self.popupID2)
- self.Bind(wx.EVT_MENU, self.OnPopupThree, id=self.popupID3)
- self.Bind(wx.EVT_MENU, self.OnTgen_glob, id=self.popup_Tgen_glob)
- self.Bind(wx.EVT_MENU, self.OnMakeTgen, id=self.onmaketgen)
+ self.Bind(wx.EVT_MENU, self.OnPopupOne, id = self.popupID1)
+ self.Bind(wx.EVT_MENU, self.OnPopupTwo, id = self.popupID2)
+ self.Bind(wx.EVT_MENU, self.OnPopupThree, id = self.popupID3)
+ self.Bind(wx.EVT_MENU, self.OnTgen_glob, id = self.popup_Tgen_glob)
+ self.Bind(wx.EVT_MENU, self.OnMakeTgen, id = self.onmaketgen)
+ self.Bind(wx.EVT_MENU, self.OnTgenDetails, id = self.id_tgendetails)
#self.Bind(wx.EVT_MENU, self.onstcaract, id = self.ID_stcaract)
# make a menu
menu = wx.Menu()
# add some items
- menu.Append(self.popupID1, u"Formes associées")
- menu.Append(self.popupID2, u"Concordancier")
- menu.Append(self.popupID3, u"Graphique")
+ menu.Append(self.popupID1, _(u"Associated forms").decode('utf8'))
+ menu.Append(self.popupID2, _(u"Concordance").decode('utf8'))
+ menu.Append(self.popupID3, _(u"Graphic").decode('utf8'))
menu_stcaract = wx.Menu()
self.menuid = {}
- for i, et in enumerate(self.etoiles) :
- nid = wx.NewId()
- self.menuid[nid] = i
- menu_stcaract.Append(nid, et)
- self.Bind(wx.EVT_MENU, self.onstcaract, id = nid)
- menu.AppendMenu(-1, u"Segments de texte caractéristiques", menu_stcaract)
- #menu.Append(self.popup_Tgen_glob, "Tgen global")
if not self.tgen :
- menu.Append(self.onmaketgen, "Make Tgen")
+ for i, et in enumerate(self.etoiles) :
+ nid = wx.NewId()
+ self.menuid[nid] = i
+ menu_stcaract.Append(nid, et)
+ self.Bind(wx.EVT_MENU, self.onstcaract, id = nid)
+ menu.AppendMenu(-1, _(u"Typical text segments").decode('utf8'), menu_stcaract)
+ menu.Append(self.onmaketgen, _(u"Make Tgen").decode('utf8'))
+ else :
+ menu.Append(self.id_tgendetails, _(u'Tgen details').decode('utf8'))
self.PopupMenu(menu)
menu.Destroy()
@@ -231,7 +234,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor
rep.append([corpus.getforme(forme).forme, corpus.getforme(forme).freq])
rep.sort(key = itemgetter(1), reverse = True)
items = dict([[i, '' + '\t:\t'.join([str(val) for val in forme]) + ''] for i, forme in enumerate(rep)])
- win = message(self, items, u"Formes associées", (300, 200))
+ win = message(self, items, _(u"Associated forms").decode('utf8'), (300, 200))
#win = message(self, u"Formes associées", (300, 200))
#win.html = '\n' + '
'.join([' : '.join([str(val) for val in forme]) for forme in rep]) + '\n'
#win.HtmlPage.SetPage(win.html)
@@ -272,7 +275,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor
nuces = [val[1] for val in ntab2]
ucis_txt, ucestxt = doconcorde(corpus, nuces, self.la)
items = dict([[i, '
'.join([ucis_txt[i], '
score : %.2f |