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()
#----------------------------------------------------------------------------
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
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
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) :
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):
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 :
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]
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 ):
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 )
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 )
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 )
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 )
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 )
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 )
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)
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 = "<img src='%s'>" % tmpgraph
else :
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'])
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))
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
##########################################################
'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):
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'))
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()
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()
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)
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()
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)
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)
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()
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 :
if not menu_pos is None :
self.mb.EnableTop(menu_pos, Show)
self.mb.UpdateMenus()
-
+ self._mgr.Update()
#--------------------------------------------------------------------
def OnClose(self, event):
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)
#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) :
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 <ratinaud@univ-tlse2.fr>\n"
"Language-Team: LANGUAGE <ratinaud@univ-tlse2.fr>\n"
msgid "Add cluster size"
msgstr "Ajouter la taille des classes"
-#: ProfList.py:700
+#: ProfList.py:689
msgid "All segments"
msgstr "Tous les segments"
msgid "Antiprofiles"
msgstr "Antiprofils"
-#: ProfList.py:332
+#: ProfList.py:327
msgid "Antonym"
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"
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"
msgid "Cleaning"
msgstr "Nettoyage"
-#: ProfList.py:767
+#: ProfList.py:756
msgid "Close"
msgstr "Fermer"
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"
msgid "Default values"
msgstr "Valeurs par défaut"
-#: ProfList.py:329
+#: ProfList.py:324
msgid "Definition"
msgstr "Définition"
msgid "Edition"
msgstr "Edition"
-#: ProfList.py:330
+#: ProfList.py:325
msgid "Etymology"
msgstr "Etymologie"
msgid "Export for ..."
msgstr "Exporter pour ..."
-#: ProfList.py:342
+#: ProfList.py:337
msgid "Export for Tropes"
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"
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"
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"
msgid "Home page"
msgstr "Page d'accueil"
-#: dialog.py:1869
+#: dialog.py:1869 dialog.py:3128
msgid "Image format"
msgstr "Format de l'image"
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"
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"
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"
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 ..."
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"
msgid "Previous"
msgstr "Précédent"
-#: ProfList.py:428 ProfList.py:462
+#: ProfList.py:417 ProfList.py:451
msgid "Problem"
msgstr "Problème"
msgid "Prototypical analysis"
msgstr "Analyses Prototypiques"
-#: ProfList.py:334
+#: ProfList.py:329
msgid "Proxemy"
msgstr "Proxémie"
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"
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"
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"
msgid "Similarities Analysis"
msgstr "Analyses de similitudes"
+#: dialog.py:3093
+msgid "Size"
+msgstr ""
+
#: OptionAlceste.py:31
msgid "Size of rst1"
msgstr "Taille de rst1"
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"
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é"
msgid "Tools"
msgstr "Outils"
-#: ProfList.py:335
+#: ProfList.py:330
msgid "Tools from CNRTL (french only)"
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"
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"
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)"
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"
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"
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"
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"
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Add cluster size"
msgstr ""
-#: ProfList.py:700
+#: ProfList.py:689
msgid "All segments"
msgstr ""
msgid "Antiprofiles"
msgstr ""
-#: ProfList.py:332
+#: ProfList.py:327
msgid "Antonym"
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 ""
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 ""
msgid "Cleaning"
msgstr ""
-#: ProfList.py:767
+#: ProfList.py:756
msgid "Close"
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 ""
msgid "Default values"
msgstr ""
-#: ProfList.py:329
+#: ProfList.py:324
msgid "Definition"
msgstr ""
msgid "Edition"
msgstr ""
-#: ProfList.py:330
+#: ProfList.py:325
msgid "Etymology"
msgstr ""
msgid "Export for ..."
msgstr ""
-#: ProfList.py:342
+#: ProfList.py:337
msgid "Export for Tropes"
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 ""
msgid "Graph analysis"
msgstr ""
-#: ProfList.py:337 ProfList.py:362
+#: ProfList.py:332 ProfList.py:357
msgid "Graph of cluster"
msgstr ""
msgid "Graph settings"
msgstr ""
-#: listlex.py:200 listlex.py:345
+#: dialog.py:3266 listlex.py:200 listlex.py:345
msgid "Graphic"
msgstr ""
msgid "Home page"
msgstr ""
-#: dialog.py:1869
+#: dialog.py:1869 dialog.py:3128
msgid "Image format"
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 ""
msgid "List of not plotted points : "
msgstr ""
-#: listlex.py:210 ProfList.py:327
+#: listlex.py:210 ProfList.py:322
msgid "Make Tgen"
msgstr ""
msgid "Modalities (one by line, with the *)"
msgstr ""
-#: ProfList.py:333
+#: ProfList.py:328
msgid "Morphology"
msgstr ""
msgid "Potato mode (less precise, faster)"
msgstr ""
-#: iramuteq.py:251
+#: dialog.py:3085 iramuteq.py:251
msgid "Preferences"
msgstr ""
msgid "Previous"
msgstr ""
-#: ProfList.py:428 ProfList.py:462
+#: ProfList.py:417 ProfList.py:451
msgid "Problem"
msgstr ""
msgid "Prototypical analysis"
msgstr ""
-#: ProfList.py:334
+#: ProfList.py:329
msgid "Proxemy"
msgstr ""
msgid "Rename"
msgstr ""
-#: ProfList.py:338 ProfList.py:590
+#: ProfList.py:333 ProfList.py:579
msgid "Repeated segments"
msgstr ""
msgid "Save as ..."
msgstr ""
+#: dialog.py:3222
+msgid "Save as..."
+msgstr ""
+
#: dialog.py:1736 guifunct.py:219
msgid "Score"
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 ""
msgid "Similarities Analysis"
msgstr ""
+#: dialog.py:3093
+msgid "Size"
+msgstr ""
+
#: OptionAlceste.py:31
msgid "Size of rst1"
msgstr ""
msgid "Supplementary variables are marked with a *"
msgstr ""
-#: ProfList.py:331
+#: ProfList.py:326
msgid "Synonymous"
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 ""
msgid "Tools"
msgstr ""
-#: ProfList.py:335
+#: ProfList.py:330
msgid "Tools from CNRTL (french only)"
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 ""
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 ""
msgid "antiprofiles"
msgstr ""
+#: dialog.py:3097
+msgid "automatic"
+msgstr ""
+
#: dialog.py:2907 dialog.py:2927
msgid "automatic (mean)"
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 ""
msgid "line classified on"
msgstr ""
-#: dialog.py:2907 dialog.py:2927
+#: dialog.py:2907 dialog.py:2927 dialog.py:3097
msgid "manual"
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 ""
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) :
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)
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)
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 ):
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
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'])
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) :
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'))
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)
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']