From: pierre Date: Wed, 10 Dec 2014 23:04:57 +0000 (+0100) Subject: ... X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=commitdiff_plain;h=7cc2905d5f514220c771dbd6661e3242681db706;hp=346f3426ba279047ab30450bb2fd6c9ebc403c3d ... Merge branch 'master' of http://www.iramuteq.org/git/iramuteq --- diff --git a/PrintRScript.py b/PrintRScript.py index deaddf5..fbcf5cf 100644 --- a/PrintRScript.py +++ b/PrintRScript.py @@ -1189,7 +1189,7 @@ class ProtoScript(PrintRScript) : open_file_graph("%s",height=800, width=1000) prototypical(mat, mfreq = %s, mrank = %s, cloud = FALSE, cexrange=c(1,2.4), cexalpha= c(0.4, 1), type = '%s') dev.off() - """ % (self.analyse.pathout['table.csv'], self.analyse.pathout['proto.png'], self.parametres['limfreq'], self.parametres['limrang'], self.parametres['typegraph']) + """ % (ffr(self.analyse.pathout['table.csv']), ffr(self.analyse.pathout['proto.png']), self.parametres['limfreq'], self.parametres['limrang'], self.parametres['typegraph']) self.add(txt) self.write() diff --git a/ProfList.py b/ProfList.py index 1ecb47a..7bf1290 100644 --- a/ProfList.py +++ b/ProfList.py @@ -14,10 +14,8 @@ #---------------------------------------------------------------------------- import os -import sys import wx import wx.lib.mixins.listctrl as listmix -#from tabsimi import DoSimi from listlex import ListForSpec from chemins import ConstructPathOut, ffr from dialog import PrefUCECarac, SearchDial, message, BarFrame @@ -28,9 +26,6 @@ import webbrowser import tempfile import codecs from functions import progressbar, treat_var_mod, doconcorde -from PrintRScript import barplot -from textclassechd import ClasseCHD -from shutil import copyfile from operator import itemgetter from copy import copy @@ -372,9 +367,6 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col parametres['type'] = 'clustercloud' parametres['prof'] = self.Source.pathout['actprof_classe_%i.csv' % self.cl] del parametres['uuid'] - #if not os.path.exists(self.Source.pathout['actprof_classe_%i.csv' % self.lc]) : - # with open(self.Source.pathout['actprof_classe_%i.csv' % self.lc], 'w') as f : - # f.write('\n'.join(prof).encode(self.parent.syscoding)) self.parent.OnClusterCloud(self.Source.corpus, parametres = parametres) def onexport(self, evt) : @@ -388,9 +380,6 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col dial = wx.MessageDialog(self, self.Source.pathout['classe_%i_export.txt' % self.cl], u"Export", wx.OK|wx.ICON_INFORMATION) dial.ShowModal() dial.Destroy() - #if 'corpus' in dir(self.Source): - # corpus = self.Source.corpus - #ClasseCHD(self.parent, corpus, self.cl) def onexporttropes(self, evt) : if 'corpus' in dir(self.Source): @@ -596,7 +585,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col if dial.ShowModal() == wx.ID_OK : limite = dial.spin_eff.GetValue() atype = dial.radio_type.GetSelection() - dlg = progressbar(self,maxi = 4) + dlg = progressbar(self.ira,maxi = 4) corpus = self.Source.corpus uces = corpus.lc[self.cl-1] if self.Source.parametres['classif_mode'] != 2 : diff --git a/analysetxt.py b/analysetxt.py index cf2b231..201e177 100644 --- a/analysetxt.py +++ b/analysetxt.py @@ -140,40 +140,3 @@ class AnalyseText : else : sleep(0.2) return check_Rresult(self.ira, pid) - - - - - - -# keys = {'art_def' : 2, -# 'pre' : 2, -# 'adj_dem' : 2, -# 'ono' : 2, -# 'pro_per' : 2, -# 'ver_sup' : 2, -# 'adv' : 1, -# 'ver' : 1, -# 'adj_ind' : 2, -# 'adj_pos' : 2, -# 'aux' : 2, -# 'adj_int' : 2, -# 'pro_ind' : 2, -# 'adj' : 1, -# 'pro_dem' : 2, -# 'nom' : 1, -# 'art_ind' : 2, -# 'pro_pos' : 2, -# 'nom_sup' : 2, -# 'adv_sup' : 2, -# 'adj_sup' : 2, -# 'adj_num' : 2, -# 'pro_rel' : 2, -# 'con' : 2, -# 'num' : 2, -# 'nr' : 1, -# 'sw' : 2, -# } -# -# gramact = [k for k in keys if keys[k] == 1] -# gramsup = [k for k in keys if keys[k] == 2] diff --git a/dialog.py b/dialog.py index e063cda..66a427a 100755 --- a/dialog.py +++ b/dialog.py @@ -2676,9 +2676,8 @@ class message(wx.Frame): self.Destroy() def OnSub(self ,evt): - parametres = {'fromuceids' : True, 'uceids' : self.uceids} - self.ira.OnSubText(None, parametres) - + parametres = {'fromuceids' : True, 'uceids' : self.uceids, 'isempty' : True} + self.ira.OnSubText(wx.MenuEvent(), None, parametres) class ExtractDialog ( wx.Dialog ): @@ -3029,7 +3028,7 @@ class SimpleDialog ( wx.Dialog ): class SubTextFromMetaDial ( wx.Dialog ): def __init__( self, parent, parametres ): - wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Subcorpus from metadata", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) + wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Subcorpus").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -3039,14 +3038,14 @@ class SubTextFromMetaDial ( wx.Dialog ): fgSizer1.SetFlexibleDirection( wx.BOTH ) fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) - self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"SubCorpus Name", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Name").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) self.subcorpusname = wx.TextCtrl( self, wx.ID_ANY, parametres['corpus_name'], wx.DefaultPosition, wx.Size( 300,-1 ), 0 ) fgSizer1.Add( self.subcorpusname, 0, wx.ALL, 5 ) - self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Select one or more metadata", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, _(u"Select one or more metadata").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) @@ -3075,14 +3074,23 @@ class SubTextFromMetaDial ( wx.Dialog ): bSizer1.Fit( self ) self.Centre( wx.BOTH ) + self.Bind(wx.EVT_LISTBOX, self.onchoose, self.m_listBox1) + if not parametres.get('isempty', False) : + self.m_sdbSizer1OK.Enable(False) def __del__( self ): pass + + def onchoose(self, evt): + if len(self.m_listBox1.GetSelections()) > 0 : + self.m_sdbSizer1OK.Enable(True) + else : + self.m_sdbSizer1OK.Enable(False) class BarGraphDialog ( wx.Dialog ): def __init__( self, parent, width, height ): - wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Preferences", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) + wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Preferences").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -3090,11 +3098,11 @@ class BarGraphDialog ( wx.Dialog ): bSizer2 = wx.BoxSizer( wx.HORIZONTAL ) - self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Size", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) bSizer2.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) - sizeradioChoices = [ u"automatic", u"manual" ] + sizeradioChoices = [ _(u"automatic").decode('utf8'), _(u"manual").decode('utf8') ] self.sizeradio = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, sizeradioChoices, 1, wx.RA_SPECIFY_COLS ) self.sizeradio.SetSelection( 0 ) bSizer2.Add( self.sizeradio, 0, wx.ALIGN_TOP|wx.ALL, 5 ) @@ -3103,14 +3111,14 @@ class BarGraphDialog ( wx.Dialog ): fgSizer1.SetFlexibleDirection( wx.BOTH ) fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) - self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"width", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, _(u"width").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) self.widthsp = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000000, 600 ) fgSizer1.Add( self.widthsp, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) - self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"height", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"height").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) @@ -3125,7 +3133,7 @@ class BarGraphDialog ( wx.Dialog ): bSizer3 = wx.BoxSizer( wx.HORIZONTAL ) - self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Image format", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, _(u"Image format").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText4.Wrap( -1 ) bSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) @@ -3219,7 +3227,7 @@ class MessageImage(wx.Frame): def OnSaveImage(self, event) : dlg = wx.FileDialog( - self, message="Enregistrer sous...", defaultDir=os.getcwd(), + self, message=_(u"Save as...").decode('utf8'), defaultDir=os.getcwd(), defaultFile= self.imagename, wildcard=self.parametres['wildcard'], style=wx.SAVE | wx.OVERWRITE_PROMPT ) dlg.SetFilterIndex(2) @@ -3263,7 +3271,7 @@ class BarFrame : with open(tmpscript,'w') as f : f.write(txt) exec_rcode(ira.RPath, tmpscript, wait = True) - win = MessageImage(ira, parametres, u"Graphique", size=(700, 500)) + win = MessageImage(ira, parametres, _(u"Graphic").decode('utf8'), size=(700, 500)) if svg == 'FALSE' : txt = "" % tmpgraph else : diff --git a/functions.py b/functions.py index f38a5c5..8cd7352 100644 --- a/functions.py +++ b/functions.py @@ -306,7 +306,7 @@ def write_tab(tab, fileout) : class BugDialog(wx.Dialog): def __init__(self, *args, **kwds): # begin wxGlade: MyDialog.__init__ - kwds["style"] = wx.DEFAULT_DIALOG_STYLE + kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.STAY_ON_TOP kwds["size"] = wx.Size(500, 200) wx.Dialog.__init__(self, *args, **kwds) self.SetTitle(kwds['title']) @@ -707,11 +707,10 @@ def progressbar(self, maxi) : parent=parent, style=wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_CAN_ABORT ) - prog.SetIcon(ira._icon) prog.SetSize((400,150)) + prog.SetIcon(ira._icon) return prog - def treat_var_mod(variables) : var_mod = {} variables = list(set(variables)) diff --git a/iramuteq.py b/iramuteq.py index 9618316..fdf2ba0 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -90,6 +90,10 @@ ID_SimiTxt = wx.NewId() ID_proto = wx.NewId() ID_ImportTXM = wx.NewId() ID_FreqMulti = wx.NewId() +ID_Splitfromvar = wx.NewId() +ID_Subtxtfrommeta = wx.NewId() +ID_Subtxtfromthem = wx.NewId() +ID_WC = wx.NewId() ########################################################## #elements de configuration ########################################################## @@ -158,6 +162,27 @@ code_langues = {'french' : 'fr_FR', 'italian' : 'it_IT', 'spanish' : 'es_ES' } + +images_analyses = { + 'textroot' : 'textroot.png', + 'alceste' : 'reinert.png', + 'corpus' : 'textcorpus.png', + 'wordcloud' :'wordcloud.png', + 'stat' :'stats.png', + 'simitxt' : 'simitxt.png', + 'clustersimitxt' :'clustersimitxt.png', + 'clustercloud' : 'clustercloud.png', + 'spec' : 'spec.png', + 'matroot' : 'matroot.png', + 'matrix' : 'matrix.png', + 'freq' : 'frequences.png', + 'freqmulti' : 'frequences.png', + 'chi2' : 'chi2.png', + 'reinertmatrix' : 'reinertmatrix.png', + 'simimatrix' : 'simimatrix.png', + 'simiclustermatrix' : 'simimatrix.png', + 'proto' : 'proto.png', + } ##################################################################### class IraFrame(wx.Frame): @@ -199,15 +224,19 @@ class IraFrame(wx.Frame): self.x = 0 # create menu #-------------------------------------------------------------------------------- + self.images_analyses = images_analyses + for img in images_analyses : + self.images_analyses[img] = wx.Image(os.path.join(self.images_path, self.images_analyses[img]), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap() self.mb = wx.MenuBar() file_menu = wx.Menu() item = wx.MenuItem(file_menu, ID_OpenData, _(u"Open a matrix").decode('utf8'), _(u"Open a matrix").decode('utf8')) - item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + #item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + item.SetBitmap(self.images_analyses['matroot']) file_menu.AppendItem(item) item = wx.MenuItem(file_menu, ID_OpenText, _(u"Open a text corpus").decode('utf8'), _(u"Open a text corpus").decode('utf8')) - item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + item.SetBitmap(self.images_analyses['textroot']) file_menu.AppendItem(item) item = wx.MenuItem(file_menu, ID_OnOpenAnalyse, _(u"Open an analysis").decode('utf8'), _(u"Open an analysis").decode('utf8')) @@ -256,17 +285,44 @@ class IraFrame(wx.Frame): view_menu.Append(ID_RESULT, _(u'Show results').decode('utf8')) #view_menu.AppendSeparator() matrix_menu = wx.Menu() - matrix_menu.Append(ID_Freq, _(u"Frequencies").decode('utf8')) - matrix_menu.Append(ID_FreqMulti, _(u'Multiple frequencies').decode('utf8')) - matrix_menu.Append(ID_Chi2, _(u"Chi2").decode('utf8')) + matanalyses = [[ID_Freq, _(u"Frequencies").decode('utf8'), 'freq'], + [ID_Freq, _(u"Multiple Frequencies").decode('utf8'), 'freqmulti'], + [ID_Chi2, _(u"Chi2").decode('utf8'), 'chi2'], + {'name' : _(u"Clustering").decode('utf8'), + 'content' : [[ID_CHDReinert, _(u"Reinert's Method").decode('utf8'), 'reinertmatrix']]}, + [ID_SIMI, _(u"Similarities Analysis").decode('utf8'), 'simimatrix'], + [ID_proto, _(u"Prototypical Analysis").decode('utf8'), 'proto'], + [ID_Splitfromvar, _(u"Split from variable").decode('utf8'), '']] + + for analyse in matanalyses : + if not isinstance(analyse, dict) : + item = wx.MenuItem(matrix_menu, analyse[0], analyse[1]) + item.SetBitmap(self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16))) + matrix_menu.AppendItem(item) + else : + nmenu = wx.Menu() + for subana in analyse['content'] : + item = wx.MenuItem(nmenu, subana[0], subana[1]) + item.SetBitmap(self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16))) + nmenu.AppendItem(item) + matrix_menu.AppendMenu(-1, analyse['name'], nmenu) + #item = wx.MenuItem(matrix_menu, ID_Freq, _(u"Frequencies").decode('utf8')) + #item.SetBitmap(self.images_analyses['freq']) + #matrix_menu.AppendItem(item) + #matrix_menu.Append(ID_Freq, _(u"Frequencies").decode('utf8')) + #item = wx.MenuItem(matrix_menu, ID_Freq, _(u"Multiple Frequencies").decode('utf8')) + #item.SetBitmap(self.images_analyses['freqmulti']) + #matrix_menu.Append(ID_FreqMulti, _(u'Multiple frequencies').decode('utf8')) + #matrix_menu.AppendItem(item) + #matrix_menu.Append(ID_Chi2, _(u"Chi2").decode('utf8')) #matrix_menu.Append(ID_Student, u"t de Student") - menu_classif = wx.Menu() - menu_classif.Append(ID_CHDReinert, _(u"Reinert's Method").decode('utf8')) + #menu_classif = wx.Menu() + #menu_classif.Append(ID_CHDReinert, _(u"Reinert's Method").decode('utf8')) #menu_classif.Append(ID_CHDSIM, u"Par matrice des distances") - matrix_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classif) + #matrix_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classif) #matrix_menu.Append(ID_AFCM, u"AFCM") - matrix_menu.Append(ID_SIMI, _(u"Similarities Analysis").decode('utf8')) - matrix_menu.Append(ID_proto, _(u"Prototypical Analysis").decode('utf8')) + #matrix_menu.Append(ID_SIMI, _(u"Similarities Analysis").decode('utf8')) + #matrix_menu.Append(ID_proto, _(u"Prototypical Analysis").decode('utf8')) ID_RCODE = wx.NewId() #matrix_menu.Append(ID_RCODE, u"Code R...") #menu_splittab = wx.Menu() @@ -277,17 +333,40 @@ class IraFrame(wx.Frame): self.matrix_menu = matrix_menu text_menu = wx.Menu() + analyses_text = [[ID_TEXTSTAT, _(u"Statistics").decode('utf8'), 'stat'], + [ID_ASLEX, _(u"Specificities and CA").decode('utf8'), 'spec'], + {'name' : _(u"Clustering").decode('utf8'), + 'content' : [[ID_TEXTREINERT, _(u"Reinert's Method").decode('utf8'), 'alceste']]}, + [ID_SimiTxt, _(u"Similarities Analysis").decode('utf8'), 'simitxt'], + [ID_WC, _(u"WordCloud").decode('utf8'), 'wordcloud'], + {'name' : _(u"Sub corpus").decode('utf8'), + 'content' : [[ID_Subtxtfrommeta, _(u'Sub corpus from metadata').decode('utf8'), None], + [ID_Subtxtfromthem, _(u'Sub corpus from thematic').decode('utf8'), None]]}, + ] + + for analyse in analyses_text : + if not isinstance(analyse, dict) : + item = wx.MenuItem(text_menu, analyse[0], analyse[1]) + item.SetBitmap(self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16))) + text_menu.AppendItem(item) + else : + nmenu = wx.Menu() + for subana in analyse['content'] : + item = wx.MenuItem(nmenu, subana[0], subana[1]) + item.SetBitmap(self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16))) + nmenu.AppendItem(item) + text_menu.AppendMenu(-1, analyse['name'], nmenu) #text_menu.Append(ID_CHECKCORPUS, u"Vérifier le corpus") - text_menu.Append(ID_TEXTSTAT, _(u"Statistics").decode('utf8')) - text_menu.Append(ID_ASLEX, _(u"Specificities and CA").decode('utf8')) - #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire") - menu_classiftxt = wx.Menu() - menu_classiftxt.Append(ID_TEXTREINERT, _(u"Reinert's Method").decode('utf8')) - #menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances") - text_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classiftxt) - text_menu.Append(ID_SimiTxt, _(u"Similarities Analysis").decode('utf8')) - ID_WC = wx.NewId() - text_menu.Append(ID_WC, _(u"WordCloud").decode('utf8')) +# text_menu.Append(ID_TEXTSTAT, _(u"Statistics").decode('utf8')) +# text_menu.Append(ID_ASLEX, _(u"Specificities and CA").decode('utf8')) +# #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire") +# menu_classiftxt = wx.Menu() +# menu_classiftxt.Append(ID_TEXTREINERT, _(u"Reinert's Method").decode('utf8')) +# #menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances") +# text_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classiftxt) +# text_menu.Append(ID_SimiTxt, _(u"Similarities Analysis").decode('utf8')) +# +# text_menu.Append(ID_WC, _(u"WordCloud").decode('utf8')) self.text_menu = text_menu help_menu = wx.Menu() @@ -317,12 +396,31 @@ class IraFrame(wx.Frame): tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.TB_FLAT | wx.TB_NODIVIDER) tb1.SetToolBitmapSize(wx.Size(16, 16)) - tb1.AddLabelTool(ID_OpenData, "OpenData", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, wx.Size(16, 16)), shortHelp="Questionnaire", longHelp="Ouvrir un questionnaire") + tb1.AddLabelTool(ID_OpenData, "OpenData", self.images_analyses['matroot'], shortHelp=_(u"Matrix").decode('utf8'), longHelp=_(u"Open a matrix").decode('utf8')) tb1.AddSeparator() - tb1.AddLabelTool(ID_OpenText, "OpenText", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, wx.Size(16, 16)), shortHelp="Texte", longHelp="Ouvrir un corpus texte") - + tb1.AddLabelTool(ID_OpenText, "OpenText", self.images_analyses['textroot'], shortHelp=_(u"Text").decode('utf8'), longHelp=_(u"Open a text corpus").decode('utf8')) + tb1.Realize() + tb_text = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, + wx.TB_FLAT | wx.TB_NODIVIDER) + for analyse in analyses_text : + if not isinstance(analyse, dict) : + tb_text.AddLabelTool(analyse[0], analyse[1], self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16)), shortHelp = analyse[1], longHelp = analyse[1]) + else : + for subana in analyse['content'] : + tb_text.AddLabelTool(subana[0], subana[1], self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16)), shortHelp = subana[1], longHelp = subana[1]) + tb_text.Realize() + + tb_mat = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, + wx.TB_FLAT | wx.TB_NODIVIDER) + for analyse in matanalyses : + if not isinstance(analyse, dict) : + tb_mat.AddLabelTool(analyse[0], analyse[1], self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16)), shortHelp = analyse[1], longHelp = analyse[1]) + else : + for subana in analyse['content'] : + tb_mat.AddLabelTool(subana[0], subana[1], self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16)), shortHelp = subana[1], longHelp = subana[1]) + tb_mat.Realize() #------------------------------------------------------------------------------------------------ self.text_ctrl_txt = wx.TextCtrl(self, -1, "", wx.Point(0, 0), wx.Size(200, 200), wx.NO_BORDER | wx.TE_MULTILINE | wx.TE_RICH2 | wx.TE_READONLY) @@ -372,7 +470,20 @@ class IraFrame(wx.Frame): self._mgr.AddPane(tb1, aui.AuiPaneInfo(). Name("tb1").Caption("Fichiers"). ToolbarPane().Top(). - LeftDockable(True).RightDockable(False)) + LeftDockable(True).RightDockable(False)) + + self._mgr.AddPane(tb_text, aui.AuiPaneInfo(). + Name("tb_text").Caption("analyse_text"). + ToolbarPane().Top(). + LeftDockable(True).RightDockable(False)) + + self._mgr.AddPane(tb_mat, aui.AuiPaneInfo(). + Name("tb_mat").Caption("analyse_matrix"). + ToolbarPane().Top(). + LeftDockable(True).RightDockable(False)) + + self._mgr.GetPane('tb_text').Hide() + self._mgr.GetPane('tb_mat').Hide() self.ShowAPane("Intro_Text") self._mgr.GetPane("lefttree").Show() @@ -402,6 +513,7 @@ class IraFrame(wx.Frame): self.Bind(wx.EVT_MENU, self.OnCHDReinert, id=ID_CHDReinert) self.Bind(wx.EVT_MENU, self.OnAFCM, id=ID_AFCM) self.Bind(wx.EVT_MENU, self.OnProto, id=ID_proto) + self.Bind(wx.EVT_MENU, self.OnSplitVar, id = ID_Splitfromvar) #self.Bind(wx.EVT_MENU, self.OnRCode, id=ID_RCODE) #self.Bind(wx.EVT_MENU, self.OnSplitVar, id=ID_SPLITVAR) #self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS) @@ -412,6 +524,8 @@ class IraFrame(wx.Frame): self.Bind(wx.EVT_MENU, self.OnPamSimple, id=ID_TEXTPAM) self.Bind(wx.EVT_MENU, self.OnSimiTxt, id=ID_SimiTxt) self.Bind(wx.EVT_MENU, self.OnWordCloud, id=ID_WC) + self.Bind(wx.EVT_MENU, self.OnSubText, id = ID_Subtxtfrommeta) + self.Bind(wx.EVT_MENU, self.OnSubText, id = ID_Subtxtfromthem) self.Bind(wx.EVT_MENU, self.OnSimiTab, id=ID_SIMI) self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) #self.Bind(wx.EVT_MENU, self.OnSaveTabAs, id=ID_SaveTab) @@ -533,7 +647,7 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" def OnVerif(self, evt) : pack = CheckRPackages(self) if pack : - dlg = wx.MessageDialog(self, u"Installation OK", u"Installation", wx.OK | wx.ICON_INFORMATION) + dlg = wx.MessageDialog(self, _(u"Installation OK").decode('utf8'), _(u"Installation").decode('utf8'), wx.OK | wx.ICON_INFORMATION | wx.STAY_ON_TOP) dlg.CenterOnParent() if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: evt.Veto() @@ -549,8 +663,16 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" def ShowMenu(self, menu, Show=True): if menu == 'text' : menu_pos = 4 + if Show : + self._mgr.GetPane('tb_text').Show() + else : + self._mgr.GetPane('tb_text').Hide() elif menu == 'matrix' : menu_pos = 3 + if Show : + self._mgr.GetPane('tb_mat').Show() + else : + self._mgr.GetPane('tb_mat').Hide() elif menu == 'view' : menu_pos = 2 else : @@ -560,7 +682,7 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" if not menu_pos is None : self.mb.EnableTop(menu_pos, Show) self.mb.UpdateMenus() - + self._mgr.Update() #-------------------------------------------------------------------- def OnClose(self, event): @@ -618,9 +740,13 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" self.ShowAPane(u"Text") self._mgr.Update() - def OnSubText(self, corpus, parametres = None): + def OnSubText(self, evt, corpus = None, parametres = None): if corpus is None : corpus = self.tree.getcorpus() + if evt.GetId() == ID_Subtxtfrommeta : + parametres = {'frommeta' : True} + elif evt.GetId() == ID_Subtxtfromthem : + parametres = {'fromtheme' : True} builder = SubBuilder(self, corpus, parametres) if builder.res == wx.ID_OK : busy = wx.BusyInfo(_("Please wait...").decode('utf8'), self) @@ -845,8 +971,10 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, États-Unis.""" #Prototypical(self, {'type' : 'proto'}) def OnSplitVar(self, evt, matrix = None): + if matrix is None : + matrix = self.tree.getmatrix() self.analyse_matrix(SplitMatrixFromVar, matrix = matrix, analyse_type = 'splitvar', parametres = {'pathout': matrix.pathout.dirout}, dlgnb = 3) - matrix = self.tree.getmatrix() + #matrix = self.tree.getmatrix() def OnSimiTxt(self, evt, corpus = None) : diff --git a/iramuteq_fr_FR.po b/iramuteq_fr_FR.po index be3646a..064b0d6 100644 --- a/iramuteq_fr_FR.po +++ b/iramuteq_fr_FR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: iramuteq 0.6 alpha 1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-12-02 18:12+0100\n" +"POT-Creation-Date: 2014-12-09 00:28+0100\n" "PO-Revision-Date: 2014-12-02 18:17+0200\n" "Last-Translator: Pierre Ratinaud \n" "Language-Team: LANGUAGE \n" @@ -45,7 +45,7 @@ msgstr "Variables actives (au moins 3)" msgid "Add cluster size" msgstr "Ajouter la taille des classes" -#: ProfList.py:700 +#: ProfList.py:689 msgid "All segments" msgstr "Tous les segments" @@ -53,7 +53,7 @@ msgstr "Tous les segments" msgid "Antiprofiles" msgstr "Antiprofils" -#: ProfList.py:332 +#: ProfList.py:327 msgid "Antonym" msgstr "Antonyme" @@ -61,8 +61,8 @@ msgstr "Antonyme" msgid "Are you sure ?" msgstr "Êtes-vous sûr ?" -#: Liste.py:163 Liste.py:180 listlex.py:198 listlex.py:233 ProfList.py:313 -#: ProfList.py:754 +#: Liste.py:163 Liste.py:180 listlex.py:198 listlex.py:233 ProfList.py:308 +#: ProfList.py:743 msgid "Associated forms" msgstr "Formes associées" @@ -138,15 +138,15 @@ msgstr "" msgid "Chi2" msgstr "Chi2" -#: ProfList.py:314 ProfList.py:359 +#: ProfList.py:309 ProfList.py:354 msgid "Chi2 by cluster" msgstr "Chi2 par classe" -#: ProfList.py:315 +#: ProfList.py:310 msgid "Chi2 by cluster on dendrogram" msgstr "Chi2 par classe et dendrogramme" -#: ProfList.py:316 ProfList.py:360 +#: ProfList.py:311 ProfList.py:355 msgid "Chi2 modalities of variable" msgstr "Chi2 modalités de la variable" @@ -166,7 +166,7 @@ msgstr "Choisissez un répertoire" msgid "Cleaning" msgstr "Nettoyage" -#: ProfList.py:767 +#: ProfList.py:756 msgid "Close" msgstr "Fermer" @@ -203,8 +203,8 @@ msgstr "Communautés" msgid "Compute Tgen" msgstr "Calculer les TGen" -#: Liste.py:164 Liste.py:191 listlex.py:199 listlex.py:294 ProfList.py:326 -#: ProfList.py:688 ProfList.py:694 ProfList.py:700 +#: Liste.py:164 Liste.py:191 listlex.py:199 listlex.py:294 ProfList.py:321 +#: ProfList.py:677 ProfList.py:683 ProfList.py:689 msgid "Concordance" msgstr "Concordancier" @@ -224,7 +224,7 @@ msgstr "Miroir par défaut de R" msgid "Default values" msgstr "Valeurs par défaut" -#: ProfList.py:329 +#: ProfList.py:324 msgid "Definition" msgstr "Définition" @@ -276,7 +276,7 @@ msgstr "Largeur des arêtes proportionnelle à l'indice" msgid "Edition" msgstr "Edition" -#: ProfList.py:330 +#: ProfList.py:325 msgid "Etymology" msgstr "Etymologie" @@ -304,7 +304,7 @@ msgstr "Export terminé. Ouvrez ce lien dans un navigateur :" msgid "Export for ..." msgstr "Exporter pour ..." -#: ProfList.py:342 +#: ProfList.py:337 msgid "Export for Tropes" msgstr "Exporter pour Tropes" @@ -312,11 +312,11 @@ msgstr "Exporter pour Tropes" msgid "Export lemma dictionary" msgstr "Exporter le dictionnaire des lemmes" -#: ProfList.py:341 +#: ProfList.py:336 msgid "Export..." msgstr "Exporter..." -#: ProfList.py:343 +#: ProfList.py:338 msgid "Exporter for Owledge" msgstr "Exporter pour Owledge" @@ -404,7 +404,7 @@ msgstr "Général" msgid "Graph analysis" msgstr "Analyse de graphe" -#: ProfList.py:337 ProfList.py:362 +#: ProfList.py:332 ProfList.py:357 msgid "Graph of cluster" msgstr "Graphe de la classe" @@ -412,7 +412,7 @@ msgstr "Graphe de la classe" msgid "Graph settings" msgstr "Paramètres du graphe" -#: listlex.py:200 listlex.py:345 +#: dialog.py:3266 listlex.py:200 listlex.py:345 msgid "Graphic" msgstr "Graphique" @@ -444,7 +444,7 @@ msgstr "Historique" msgid "Home page" msgstr "Page d'accueil" -#: dialog.py:1869 +#: dialog.py:1869 dialog.py:3128 msgid "Image format" msgstr "Format de l'image" @@ -456,15 +456,15 @@ msgstr "Importer de TXM" msgid "Import from factiva" msgstr "Importer de factiva" -#: ProfList.py:325 +#: ProfList.py:320 msgid "In all segments" msgstr "Dans tous les segments" -#: ProfList.py:323 +#: ProfList.py:318 msgid "In segments of this cluster" msgstr "Dans les segments de cette classe" -#: ProfList.py:324 +#: ProfList.py:319 msgid "In segments of this clustering" msgstr "Dans les segments de cette classification" @@ -532,7 +532,7 @@ msgstr "Rang limite" msgid "List of not plotted points : " msgstr "Liste des points non-représentés" -#: listlex.py:210 ProfList.py:327 +#: listlex.py:210 ProfList.py:322 msgid "Make Tgen" msgstr "Faire un TGen" @@ -616,7 +616,7 @@ msgstr "Nombre minimum de segments de texte par classe (2 = automatique)" msgid "Modalities (one by line, with the *)" msgstr "Modalités (une par ligne, avec l'étoile (*))" -#: ProfList.py:333 +#: ProfList.py:328 msgid "Morphology" msgstr "Morphologie" @@ -772,7 +772,7 @@ msgstr "Taille de l'image" msgid "Play a sound at the end of analysis" msgstr "Jouer un son à la fin des analyses" -#: corpus.py:1622 iramuteq.py:581 iramuteq.py:626 layout.py:946 tree.py:739 +#: corpus.py:1624 iramuteq.py:581 iramuteq.py:626 layout.py:946 tree.py:739 #: tree.py:1063 msgid "Please wait..." msgstr "Patientez ..." @@ -785,7 +785,7 @@ msgstr "Patientez... Lecture du corpus" msgid "Potato mode (less precise, faster)" msgstr "Mode patate (moins précis, plus rapide)" -#: iramuteq.py:251 +#: dialog.py:3085 iramuteq.py:251 msgid "Preferences" msgstr "Préférences" @@ -793,7 +793,7 @@ msgstr "Préférences" msgid "Previous" msgstr "Précédent" -#: ProfList.py:428 ProfList.py:462 +#: ProfList.py:417 ProfList.py:451 msgid "Problem" msgstr "Problème" @@ -809,7 +809,7 @@ msgstr "Analyses Prototypiques" msgid "Prototypical analysis" msgstr "Analyses Prototypiques" -#: ProfList.py:334 +#: ProfList.py:329 msgid "Proxemy" msgstr "Proxémie" @@ -845,7 +845,7 @@ msgstr "Méthode Reinert" msgid "Rename" msgstr "Renommer" -#: ProfList.py:338 ProfList.py:590 +#: ProfList.py:333 ProfList.py:579 msgid "Repeated segments" msgstr "Segments répétés" @@ -877,6 +877,11 @@ msgstr "Résultats" msgid "Save as ..." msgstr "Enregistrer sous ..." +#: dialog.py:3222 +#, fuzzy +msgid "Save as..." +msgstr "Enregistrer sous ..." + #: dialog.py:1736 guifunct.py:219 msgid "Score" msgstr "Indice" @@ -889,11 +894,11 @@ msgstr "Indices sur les arêtes" msgid "Search ..." msgstr "Rechercher ..." -#: ProfList.py:249 +#: ProfList.py:244 msgid "Search..." msgstr "Rechercher ..." -#: ProfList.py:694 +#: ProfList.py:683 msgid "Segments of this clustering" msgstr "Segments de cette classe" @@ -938,6 +943,10 @@ msgstr "Voir les résultats" msgid "Similarities Analysis" msgstr "Analyses de similitudes" +#: dialog.py:3093 +msgid "Size" +msgstr "" + #: OptionAlceste.py:31 msgid "Size of rst1" msgstr "Taille de rst1" @@ -1006,7 +1015,7 @@ msgstr "Formes supplémentaires" msgid "Supplementary variables are marked with a *" msgstr "Les variables supplémentaires sont marquées par une *" -#: ProfList.py:331 +#: ProfList.py:326 msgid "Synonymous" msgstr "Synonymes" @@ -1083,11 +1092,11 @@ msgstr "Ce fichier n'existe pas : %s" msgid "This file will be delete : " msgstr "Ce fichier sera supprimer : " -#: ProfList.py:462 +#: ProfList.py:451 msgid "This is not a meta-data" msgstr "Ce n'est pas une méta-donnée" -#: ProfList.py:428 +#: ProfList.py:417 msgid "This is not a variable_modality form" msgstr "Ce n'est pas une forme du type variable_modalité" @@ -1095,7 +1104,7 @@ msgstr "Ce n'est pas une forme du type variable_modalité" msgid "Tools" msgstr "Outils" -#: ProfList.py:335 +#: ProfList.py:330 msgid "Tools from CNRTL (french only)" msgstr "Outils du CNTRL (français uniquement)" @@ -1103,7 +1112,7 @@ msgstr "Outils du CNTRL (français uniquement)" msgid "Total" msgstr "Total" -#: listlex.py:209 listlex.py:274 ProfList.py:339 ProfList.py:622 +#: listlex.py:209 listlex.py:274 ProfList.py:334 ProfList.py:611 msgid "Typical text segments" msgstr "Segments de texte caractéristiques" @@ -1163,11 +1172,11 @@ msgstr "Vue" msgid "Welcome" msgstr "Bienvenue" -#: ProfList.py:340 +#: ProfList.py:335 msgid "Word cloud of cluster" msgstr "Nuage de mots de la classe" -#: ProfList.py:317 +#: ProfList.py:312 msgid "Word graph" msgstr "Graphe du mot" @@ -1203,6 +1212,11 @@ msgstr "formes actives" msgid "antiprofiles" msgstr "antiprofils" +#: dialog.py:3097 +#, fuzzy +msgid "automatic" +msgstr "automatique (moyenne)" + #: dialog.py:2907 dialog.py:2927 msgid "automatic (mean)" msgstr "automatique (moyenne)" @@ -1291,7 +1305,7 @@ msgstr "à partir de fichiers xml" msgid "graphical" msgstr "Graphique" -#: dialog.py:554 dialog.py:1826 dialog.py:1979 guifunct.py:416 +#: dialog.py:554 dialog.py:1826 dialog.py:1979 dialog.py:3113 guifunct.py:416 msgid "height" msgstr "hauteur" @@ -1307,7 +1321,7 @@ msgstr "indexation" msgid "line classified on" msgstr "lignes classées sur" -#: dialog.py:2907 dialog.py:2927 +#: dialog.py:2907 dialog.py:2927 dialog.py:3097 msgid "manual" msgstr "manuelle" @@ -1316,7 +1330,7 @@ msgid "modalities" msgstr "modalités" #: dialog.py:46 dialog.py:56 dialog.py:349 dialog.py:364 dialog.py:921 -#: dialog.py:1259 dialog.py:1331 +#: dialog.py:1056 dialog.py:1259 dialog.py:1331 msgid "no" msgstr "non" @@ -1412,12 +1426,12 @@ msgstr "pourcentage total" msgid "variables" msgstr "variables" -#: dialog.py:552 dialog.py:1837 dialog.py:1991 guifunct.py:423 +#: dialog.py:552 dialog.py:1837 dialog.py:1991 dialog.py:3106 guifunct.py:423 msgid "width" msgstr "largeur" #: dialog.py:46 dialog.py:56 dialog.py:349 dialog.py:364 dialog.py:921 -#: dialog.py:1259 dialog.py:1331 +#: dialog.py:1056 dialog.py:1259 dialog.py:1331 msgid "yes" msgstr "oui" diff --git a/locale/es_ES/LC_MESSAGES/iramuteq.mo b/locale/es_ES/LC_MESSAGES/iramuteq.mo index d2b3c56..219b0ef 100644 Binary files a/locale/es_ES/LC_MESSAGES/iramuteq.mo and b/locale/es_ES/LC_MESSAGES/iramuteq.mo differ diff --git a/locale/fr_FR/LC_MESSAGES/iramuteq.mo b/locale/fr_FR/LC_MESSAGES/iramuteq.mo index aabce4f..72cf440 100644 Binary files a/locale/fr_FR/LC_MESSAGES/iramuteq.mo and b/locale/fr_FR/LC_MESSAGES/iramuteq.mo differ diff --git a/locale/it_IT/LC_MESSAGES/iramuteq.mo b/locale/it_IT/LC_MESSAGES/iramuteq.mo index d2b3c56..219b0ef 100644 Binary files a/locale/it_IT/LC_MESSAGES/iramuteq.mo and b/locale/it_IT/LC_MESSAGES/iramuteq.mo differ diff --git a/locale/pt_PT/LC_MESSAGES/iramuteq.mo b/locale/pt_PT/LC_MESSAGES/iramuteq.mo index 863054b..56d2b12 100644 Binary files a/locale/pt_PT/LC_MESSAGES/iramuteq.mo and b/locale/pt_PT/LC_MESSAGES/iramuteq.mo differ diff --git a/messages.pot b/messages.pot index e73ae25..b5ba85f 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-12-03 18:41+0100\n" +"POT-Creation-Date: 2014-12-09 00:28+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,7 +45,7 @@ msgstr "" msgid "Add cluster size" msgstr "" -#: ProfList.py:700 +#: ProfList.py:689 msgid "All segments" msgstr "" @@ -53,7 +53,7 @@ msgstr "" msgid "Antiprofiles" msgstr "" -#: ProfList.py:332 +#: ProfList.py:327 msgid "Antonym" msgstr "" @@ -61,8 +61,8 @@ msgstr "" msgid "Are you sure ?" msgstr "" -#: Liste.py:163 Liste.py:180 listlex.py:198 listlex.py:233 ProfList.py:313 -#: ProfList.py:754 +#: Liste.py:163 Liste.py:180 listlex.py:198 listlex.py:233 ProfList.py:308 +#: ProfList.py:743 msgid "Associated forms" msgstr "" @@ -134,15 +134,15 @@ msgstr "" msgid "Chi2" msgstr "" -#: ProfList.py:314 ProfList.py:359 +#: ProfList.py:309 ProfList.py:354 msgid "Chi2 by cluster" msgstr "" -#: ProfList.py:315 +#: ProfList.py:310 msgid "Chi2 by cluster on dendrogram" msgstr "" -#: ProfList.py:316 ProfList.py:360 +#: ProfList.py:311 ProfList.py:355 msgid "Chi2 modalities of variable" msgstr "" @@ -162,7 +162,7 @@ msgstr "" msgid "Cleaning" msgstr "" -#: ProfList.py:767 +#: ProfList.py:756 msgid "Close" msgstr "" @@ -199,8 +199,8 @@ msgstr "" msgid "Compute Tgen" msgstr "" -#: Liste.py:164 Liste.py:191 listlex.py:199 listlex.py:294 ProfList.py:326 -#: ProfList.py:688 ProfList.py:694 ProfList.py:700 +#: Liste.py:164 Liste.py:191 listlex.py:199 listlex.py:294 ProfList.py:321 +#: ProfList.py:677 ProfList.py:683 ProfList.py:689 msgid "Concordance" msgstr "" @@ -220,7 +220,7 @@ msgstr "" msgid "Default values" msgstr "" -#: ProfList.py:329 +#: ProfList.py:324 msgid "Definition" msgstr "" @@ -272,7 +272,7 @@ msgstr "" msgid "Edition" msgstr "" -#: ProfList.py:330 +#: ProfList.py:325 msgid "Etymology" msgstr "" @@ -300,7 +300,7 @@ msgstr "" msgid "Export for ..." msgstr "" -#: ProfList.py:342 +#: ProfList.py:337 msgid "Export for Tropes" msgstr "" @@ -308,11 +308,11 @@ msgstr "" msgid "Export lemma dictionary" msgstr "" -#: ProfList.py:341 +#: ProfList.py:336 msgid "Export..." msgstr "" -#: ProfList.py:343 +#: ProfList.py:338 msgid "Exporter for Owledge" msgstr "" @@ -400,7 +400,7 @@ msgstr "" msgid "Graph analysis" msgstr "" -#: ProfList.py:337 ProfList.py:362 +#: ProfList.py:332 ProfList.py:357 msgid "Graph of cluster" msgstr "" @@ -408,7 +408,7 @@ msgstr "" msgid "Graph settings" msgstr "" -#: listlex.py:200 listlex.py:345 +#: dialog.py:3266 listlex.py:200 listlex.py:345 msgid "Graphic" msgstr "" @@ -440,7 +440,7 @@ msgstr "" msgid "Home page" msgstr "" -#: dialog.py:1869 +#: dialog.py:1869 dialog.py:3128 msgid "Image format" msgstr "" @@ -452,15 +452,15 @@ msgstr "" msgid "Import from factiva" msgstr "" -#: ProfList.py:325 +#: ProfList.py:320 msgid "In all segments" msgstr "" -#: ProfList.py:323 +#: ProfList.py:318 msgid "In segments of this cluster" msgstr "" -#: ProfList.py:324 +#: ProfList.py:319 msgid "In segments of this clustering" msgstr "" @@ -528,7 +528,7 @@ msgstr "" msgid "List of not plotted points : " msgstr "" -#: listlex.py:210 ProfList.py:327 +#: listlex.py:210 ProfList.py:322 msgid "Make Tgen" msgstr "" @@ -610,7 +610,7 @@ msgstr "" msgid "Modalities (one by line, with the *)" msgstr "" -#: ProfList.py:333 +#: ProfList.py:328 msgid "Morphology" msgstr "" @@ -779,7 +779,7 @@ msgstr "" msgid "Potato mode (less precise, faster)" msgstr "" -#: iramuteq.py:251 +#: dialog.py:3085 iramuteq.py:251 msgid "Preferences" msgstr "" @@ -787,7 +787,7 @@ msgstr "" msgid "Previous" msgstr "" -#: ProfList.py:428 ProfList.py:462 +#: ProfList.py:417 ProfList.py:451 msgid "Problem" msgstr "" @@ -803,7 +803,7 @@ msgstr "" msgid "Prototypical analysis" msgstr "" -#: ProfList.py:334 +#: ProfList.py:329 msgid "Proxemy" msgstr "" @@ -839,7 +839,7 @@ msgstr "" msgid "Rename" msgstr "" -#: ProfList.py:338 ProfList.py:590 +#: ProfList.py:333 ProfList.py:579 msgid "Repeated segments" msgstr "" @@ -871,6 +871,10 @@ msgstr "" msgid "Save as ..." msgstr "" +#: dialog.py:3222 +msgid "Save as..." +msgstr "" + #: dialog.py:1736 guifunct.py:219 msgid "Score" msgstr "" @@ -883,11 +887,11 @@ msgstr "" msgid "Search ..." msgstr "" -#: ProfList.py:249 +#: ProfList.py:244 msgid "Search..." msgstr "" -#: ProfList.py:694 +#: ProfList.py:683 msgid "Segments of this clustering" msgstr "" @@ -932,6 +936,10 @@ msgstr "" msgid "Similarities Analysis" msgstr "" +#: dialog.py:3093 +msgid "Size" +msgstr "" + #: OptionAlceste.py:31 msgid "Size of rst1" msgstr "" @@ -1000,7 +1008,7 @@ msgstr "" msgid "Supplementary variables are marked with a *" msgstr "" -#: ProfList.py:331 +#: ProfList.py:326 msgid "Synonymous" msgstr "" @@ -1077,11 +1085,11 @@ msgstr "" msgid "This file will be delete : " msgstr "" -#: ProfList.py:462 +#: ProfList.py:451 msgid "This is not a meta-data" msgstr "" -#: ProfList.py:428 +#: ProfList.py:417 msgid "This is not a variable_modality form" msgstr "" @@ -1089,7 +1097,7 @@ msgstr "" msgid "Tools" msgstr "" -#: ProfList.py:335 +#: ProfList.py:330 msgid "Tools from CNRTL (french only)" msgstr "" @@ -1097,7 +1105,7 @@ msgstr "" msgid "Total" msgstr "" -#: listlex.py:209 listlex.py:274 ProfList.py:339 ProfList.py:622 +#: listlex.py:209 listlex.py:274 ProfList.py:334 ProfList.py:611 msgid "Typical text segments" msgstr "" @@ -1157,11 +1165,11 @@ msgstr "" msgid "Welcome" msgstr "" -#: ProfList.py:340 +#: ProfList.py:335 msgid "Word cloud of cluster" msgstr "" -#: ProfList.py:317 +#: ProfList.py:312 msgid "Word graph" msgstr "" @@ -1197,6 +1205,10 @@ msgstr "" msgid "antiprofiles" msgstr "" +#: dialog.py:3097 +msgid "automatic" +msgstr "" + #: dialog.py:2907 dialog.py:2927 msgid "automatic (mean)" msgstr "" @@ -1285,7 +1297,7 @@ msgstr "" msgid "graphical" msgstr "" -#: dialog.py:554 dialog.py:1826 dialog.py:1979 guifunct.py:416 +#: dialog.py:554 dialog.py:1826 dialog.py:1979 dialog.py:3113 guifunct.py:416 msgid "height" msgstr "" @@ -1301,7 +1313,7 @@ msgstr "" msgid "line classified on" msgstr "" -#: dialog.py:2907 dialog.py:2927 +#: dialog.py:2907 dialog.py:2927 dialog.py:3097 msgid "manual" msgstr "" @@ -1406,7 +1418,7 @@ msgstr "" msgid "variables" msgstr "" -#: dialog.py:552 dialog.py:1837 dialog.py:1991 guifunct.py:423 +#: dialog.py:552 dialog.py:1837 dialog.py:1991 dialog.py:3106 guifunct.py:423 msgid "width" msgstr "" diff --git a/profile_segment.py b/profile_segment.py index b0ca4c4..e0f68b8 100644 --- a/profile_segment.py +++ b/profile_segment.py @@ -12,6 +12,7 @@ from functions import exec_rcode, check_Rresult, ReadProfileAsDico, ReadList from listlex import * from dialog import PrefSegProf, PrefProfTypes from time import sleep +from chemins import ffr class ProfileSegment() : def __init__(self, parent, pathout, parametres, corpus) : @@ -46,13 +47,13 @@ class ProfileSegment() : txt = """ load("%s") source("%s") - """ % (self.dictpathout['RData'], self.parent.RscriptsPath['chdfunct']) + """ % (ffr(self.dictpathout['RData']), ffr(self.parent.RscriptsPath['chdfunct'])) txt += """ dt <- read.csv2("%s", row.names = 1) to <- build.pond.prof(dt) PrintProfile(n1,to[4],NULL,to[5],NULL,clnb,"%s","%s") - """ % (self.corpus.dictpathout['segments_classes'], self.dictpathout['prof_seg'], self.dictpathout['antiprof_seg']) + """ % (ffr(self.corpus.dictpathout['segments_classes']), ffr(self.dictpathout['prof_seg']), ffr(self.dictpathout['antiprof_seg'])) fo = tempfile.mktemp(dir=self.parent.TEMPDIR) with open(fo, 'w') as f : f.write(txt) @@ -109,21 +110,21 @@ class ProfilType() : txt = """ load("%s") source("%s") - """ % (self.corpus.dictpathout['RData'], self.parent.RscriptsPath['chdfunct']) + """ % (ffr(self.corpus.dictpathout['RData']), ffr(self.parent.RscriptsPath['chdfunct'])) txt += """ dt <- read.csv2("%s", row.names = 1) - """ % self.corpus.dictpathout['type_cl'] + """ % ffr(self.corpus.dictpathout['type_cl']) if alceste : txt += """ to <- build.pond.prof(dt) PrintProfile(n1,to[4],NULL,to[5],NULL,clnb,"%s","%s") - """ % (self.outprof, self.corpus.dictpathout['antiprof_type']) + """ % (ffr(self.outprof), ffr(self.corpus.dictpathout['antiprof_type'])) else : txt += """ to <- AsLexico2(dt) write.csv2(to[[1]], file = "%s") - """ % (self.outprof) + """ % (ffr(self.outprof)) # write.csv2(to[[3]], file = "%s") # % (self.outprof) fo = tempfile.mktemp(dir=self.parent.TEMPDIR) diff --git a/tree.py b/tree.py index 12627f4..5b4b616 100644 --- a/tree.py +++ b/tree.py @@ -22,6 +22,27 @@ from textreinert import TgenProf log = logging.getLogger('iramuteq.tree') +def buildmenu(menu, parent_menu): + for i in range(parent_menu.GetMenuItemCount()) : + item = parent_menu.FindItemByPosition(i) + itemid = item.GetId() + itemtext = item.GetText() + itemicon = item.GetBitmap() + nitem = wx.MenuItem(menu, itemid, itemtext) + nitem.SetBitmap(itemicon) + if item.IsSubMenu() : + nmenu = wx.Menu() + for val in item.GetSubMenu().GetMenuItems() : + itemid = val.GetId() + itemtext = val.GetText() + itemicon = val.GetBitmap() + nitem = wx.MenuItem(menu, itemid, itemtext) + nitem.SetBitmap(itemicon) + nmenu.AppendItem(nitem) + menu.AppendMenu(-1, item.GetText(), nmenu) + else : + menu.AppendItem(nitem) + class InfoDialog ( wx.Dialog ): def __init__( self, parent, txt, parametres ): @@ -110,26 +131,11 @@ class LeftTree(CT.CustomTreeCtrl): self.styles = treestyles self.item = None + self.il = wx.ImageList(16, 16) self.ild = {} - imgtextroot = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'textroot.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['alceste'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'reinert.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['corpus'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'textcorpus.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['wordcloud'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'wordcloud.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['stat'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'stats.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['simitxt'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simitxt.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['clustersimitxt'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'clustersimitxt.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['clustercloud'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'clustercloud.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['spec'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'spec.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - imgmatroot = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'matroot.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['matrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'matrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['freq'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'frequences.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['freqmulti'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'frequences.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['chi2'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'chi2.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['reinertmatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'reinertmatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['simimatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simimatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['simiclustermatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simimatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) - self.ild['proto'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'proto.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) + for img in self.ira.images_analyses : + self.ild[img] = self.il.Add(self.ira.images_analyses[img]) self.SetImageList(self.il) self.count = 0 @@ -146,8 +152,8 @@ class LeftTree(CT.CustomTreeCtrl): 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) + self.SetItemImage(self.textroot, self.ild['textroot'], CT.TreeItemIcon_Normal) + self.SetItemImage(self.textroot, self.ild['textroot'], CT.TreeItemIcon_Expanded) for corpus in reversed(self.h) : child = self.AppendItem(self.textroot, corpus['corpus_name']) @@ -168,8 +174,8 @@ class LeftTree(CT.CustomTreeCtrl): 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) + self.SetItemImage(self.matroot, self.ild['matroot'], CT.TreeItemIcon_Normal) + self.SetItemImage(self.matroot, self.ild['matroot'], CT.TreeItemIcon_Expanded) orphmat = [] for matrix in reversed(self.history.matrix) : @@ -391,54 +397,11 @@ class LeftTree(CT.CustomTreeCtrl): menu.AppendSeparator() if 'corpus_name' in pydata : - stat = menu.Append(wx.ID_ANY, _(u"Statistics").decode('utf8')) - spec = menu.Append(wx.ID_ANY, _(u"Specificities and CA").decode('utf8')) - classification = wx.Menu() - reinert = classification.Append(wx.ID_ANY, _(u"Reinert's Method").decode('utf8')) - #pam = classification.Append(wx.ID_ANY, u"Par matrice des distances") - menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), classification) - simi = menu.Append(wx.ID_ANY, _(u"Similarities Analysis").decode('utf8')) - wdc = menu.Append(wx.ID_ANY, _(u"WordCloud").decode('utf8')) - subcorpus = wx.Menu() - subcorpusfrommeta = subcorpus.Append(wx.ID_ANY, _(u'Sub corpus from metadata').decode('utf8')) - subcorpusfromtheme = subcorpus.Append(wx.ID_ANY, _(u'Sub corpus from thematic').decode('utf8')) - menu.AppendMenu(-1, _(u"Sub corpus").decode('utf8'), subcorpus) + buildmenu(menu, self.parent.text_menu) menu.AppendSeparator() - self.Bind(wx.EVT_MENU, self.OnReinert, reinert) - #self.Bind(wx.EVT_MENU, self.OnPam, pam) - self.Bind(wx.EVT_MENU, self.OnStat, stat) - self.Bind(wx.EVT_MENU, self.OnSpec, spec) - self.Bind(wx.EVT_MENU, self.OnSimiTxt, simi) - self.Bind(wx.EVT_MENU, self.OnWordCloud, wdc) - self.Bind(wx.EVT_MENU, self.OnSubTextFromMeta, subcorpusfrommeta) - self.Bind(wx.EVT_MENU, self.OnSubTextFromTheme, subcorpusfromtheme) elif 'matrix_name' in pydata : - for i in range(self.parent.matrix_menu.GetMenuItemCount()) : - item = self.parent.matrix_menu.FindItemByPosition(i) - itemid = item.GetId() - itemtext = item.GetText() - if item.IsSubMenu() : - nmenu = wx.Menu() - for val in item.GetSubMenu().GetMenuItems() : - nmenu.Append(val.GetId(), val.GetText()) - menu.AppendMenu(itemid, itemtext, nmenu) - else : - menu.Append(itemid, itemtext) - split = wx.Menu() - splitfromvar = split.Append(-1, _(u"Split from variable").decode('utf8')) - menu.AppendMenu(-1, _(u"Split matrix").decode('utf8'), split) - self.Bind(wx.EVT_MENU, self.OnSplitFromVar, splitfromvar) - #print item, itemid, itemtext - #menu = self.parent.matrix_menu - #freq = menu.Append(wx.ID_ANY, _(u"Frequency").decode('utf8')) - #chi2 = menu.Append(wx.ID_ANY, _(u"Chi square").decode('utf8')) - #chdreinert = menu.Append(wx.ID_ANY, _(u"Reinert clustering").decode('utf8')) - #simi = menu.Append(wx.ID_ANY, _(u"Similarity analysis").decode('utf8')) + buildmenu(menu, self.parent.matrix_menu) menu.AppendSeparator() - #self.Bind(wx.EVT_MENU, self.OnFreq, freq) - #self.Bind(wx.EVT_MENU, self.OnChiSquare, chi2) - #self.Bind(wx.EVT_MENU, self.OnSimiTab, simi) - #self.Bind(wx.EVT_MENU, self.OnCHDReinert, chdreinert) elif pydata.get('type', False) == 'alceste' and pydata['uuid'] in self.parent.history.opened : openmenu = wx.Menu() antipro = openmenu.Append(wx.ID_ANY, _(u"Antiprofiles").decode('utf8')) @@ -556,29 +519,29 @@ class LeftTree(CT.CustomTreeCtrl): def OnWordCloud(self, evt) : self.parent.OnWordCloud(evt, self.getcorpus()) - def OnFreq(self, evt): - self.parent.OnFreq(evt, self.getmatrix()) +# def OnFreq(self, evt): +# self.parent.OnFreq(evt, self.getmatrix()) - def OnChiSquare(self, evt): - self.parent.OnChi2(evt, self.getmatrix()) +# def OnChiSquare(self, evt): +# self.parent.OnChi2(evt, self.getmatrix()) - def OnSimiTab(self, evt): - self.parent.OnSimiTab(evt, self.getmatrix()) +# def OnSimiTab(self, evt): +# self.parent.OnSimiTab(evt, self.getmatrix()) - def OnProto(self, evt): - self.parent.OnProto(evt, self.getmatrix()) +# def OnProto(self, evt): +# self.parent.OnProto(evt, self.getmatrix()) - def OnSplitFromVar(self, evt): - self.parent.OnSplitVar(evt, self.getmatrix()) +# def OnSplitFromVar(self, evt): +# self.parent.OnSplitVar(evt, self.getmatrix()) - def OnCHDReinert(self, evt): - self.parent.OnCHDReinert(evt, self.getmatrix()) +# def OnCHDReinert(self, evt): +# self.parent.OnCHDReinert(evt, self.getmatrix()) - def OnSubTextFromMeta(self, evt): - self.parent.OnSubText(self.getcorpus(), parametres = {'frommeta' : True}) + #def OnSubTextFromMeta(self, evt): + # self.parent.OnSubText(self.getcorpus(), parametres = {'frommeta' : True}) - def OnSubTextFromTheme(self, evt): - self.parent.OnSubText(self.getcorpus(), parametres = {'fromtheme' : True}) + #def OnSubTextFromTheme(self, evt): + # self.parent.OnSubText(self.getcorpus(), parametres = {'fromtheme' : True}) def OnProfSR(self, evt) : ProfileSegment(self.parent, self.page.dictpathout, self.page.parametres, self.page.corpus) @@ -746,7 +709,7 @@ class LeftTree(CT.CustomTreeCtrl): dial.Destroy() def OnSubCorpusFromClusters(self, evt): - self.parent.OnSubText(self.getcorpus(), parametres = {'fromclusters' : True, 'clnb': self.page.parametres['clnb'], 'lc' : self.page.corpus.lc}) + self.parent.OnSubText(evt, corpus = self.getcorpus(), parametres = {'fromclusters' : True, 'clnb': self.page.parametres['clnb'], 'lc' : self.page.corpus.lc}) def OnRename(self, event): pydata = self.itemdict['pydata']