AFC
[iramuteq] / dialog.py
index 44b7dc8..e97d19e 100755 (executable)
--- a/dialog.py
+++ b/dialog.py
@@ -589,6 +589,10 @@ class PrefGraph(wx.Dialog):
         self.label_4 = wx.StaticText(self, -1, txt)
         self.check1 = wx.CheckBox(self, -1)
         self.spin_nb = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)
         self.label_4 = wx.StaticText(self, -1, txt)
         self.check1 = wx.CheckBox(self, -1)
         self.spin_nb = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)
+        txt = u"""Prendre les x premiers points par classe"""
+        self.label_chic = wx.StaticText(self, -1, txt)
+        self.check_chic = wx.CheckBox(self, -1)
+        self.spin_nbchic = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)        
         txt = u"""Limiter le nombre de points 
 par le chi2 de liaison aux classes"""
         self.label_5 = wx.StaticText(self, -1, txt)
         txt = u"""Limiter le nombre de points 
 par le chi2 de liaison aux classes"""
         self.label_5 = wx.StaticText(self, -1, txt)
@@ -643,6 +647,7 @@ au chi2 d'association de la forme"""
         self.Bind(wx.EVT_CHECKBOX, self.OnCheckTchi, self.check_tchi)
         self.Bind(wx.EVT_CHOICE, self.On3D, self.choicetype)
         self.Bind(wx.EVT_CHOICE, self.OnPass, self.choice2)
         self.Bind(wx.EVT_CHECKBOX, self.OnCheckTchi, self.check_tchi)
         self.Bind(wx.EVT_CHOICE, self.On3D, self.choicetype)
         self.Bind(wx.EVT_CHOICE, self.OnPass, self.choice2)
+        self.Bind(wx.EVT_CHECKBOX, self.OnCheckChic, self.check_chic)
         self.__set_properties()
         self.OnNorm(wx.EVT_CHECKBOX)
         self.OnCheckTchi(wx.EVT_CHECKBOX)
         self.__set_properties()
         self.OnNorm(wx.EVT_CHECKBOX)
         self.OnCheckTchi(wx.EVT_CHECKBOX)
@@ -663,14 +668,29 @@ au chi2 d'association de la forme"""
         self.spin3.SetValue(self.paramgraph['taillecar'])
         self.spin_nb.SetValue(self.paramgraph['select_nb'])
         self.spin_chi.SetValue(self.paramgraph['select_chi'])
         self.spin3.SetValue(self.paramgraph['taillecar'])
         self.spin_nb.SetValue(self.paramgraph['select_nb'])
         self.spin_chi.SetValue(self.paramgraph['select_chi'])
+        self.spin_nbchic.SetValue(self.paramgraph['nbchic'])
         self.check1.SetValue(self.paramgraph['do_select_nb'])
         self.check2.SetValue(self.paramgraph['do_select_chi'])
         self.check1.SetValue(self.paramgraph['do_select_nb'])
         self.check2.SetValue(self.paramgraph['do_select_chi'])
+        self.check_chic.SetValue(self.paramgraph['do_select_chi_classe'])
         self.check3.SetValue(self.paramgraph['over'])
         if self.paramgraph['do_select_nb'] :
             self.spin_nb.Enable(True)
             self.spin_chi.Enable(False)
         self.check3.SetValue(self.paramgraph['over'])
         if self.paramgraph['do_select_nb'] :
             self.spin_nb.Enable(True)
             self.spin_chi.Enable(False)
+            self.spin_nbchic.Enable(False)
+        elif self.paramgraph['do_select_chi_classe'] :
+            self.spin_nb.Enable(False)
+            self.spin_chi.Enable(False)
+            self.spin_nbchic.Enable(True)
+        elif self.paramgraph['do_select_chi'] :
+            self.spin_nb.Enable(False)
+            self.spin_chi.Enable(True)
+            self.spin_nbchic.Enable(False)
         else :
             self.spin_nb.Enable(False)
         else :
             self.spin_nb.Enable(False)
+            self.spin_chi.Enable(False)
+            self.spin_nbchic.Enable(False)
+
+            
         self.check4.SetValue(self.paramgraph['cex_txt'])
         self.spin_min.SetValue(self.paramgraph['txt_min'])
         self.spin_max.SetValue(self.paramgraph['txt_max'])
         self.check4.SetValue(self.paramgraph['cex_txt'])
         self.spin_min.SetValue(self.paramgraph['txt_min'])
         self.spin_max.SetValue(self.paramgraph['txt_max'])
@@ -678,11 +698,6 @@ au chi2 d'association de la forme"""
         self.spin_min_tchi.SetValue(self.paramgraph['tchi_min'])
         self.spin_max_tchi.SetValue(self.paramgraph['tchi_max'])
 
         self.spin_min_tchi.SetValue(self.paramgraph['tchi_min'])
         self.spin_max_tchi.SetValue(self.paramgraph['tchi_max'])
 
-        if self.paramgraph['do_select_chi'] :
-            self.spin_nb.Enable(False)
-            self.spin_chi.Enable(True)    
-        else :
-            self.spin_chi.Enable(False)            
         self.spin_f1.SetValue(self.paramgraph['facteur'][0])
         self.spin_f2.SetValue(self.paramgraph['facteur'][1])
         self.spin_f3.SetValue(self.paramgraph['facteur'][2])
         self.spin_f1.SetValue(self.paramgraph['facteur'][0])
         self.spin_f2.SetValue(self.paramgraph['facteur'][1])
         self.spin_f3.SetValue(self.paramgraph['facteur'][2])
@@ -739,6 +754,14 @@ au chi2 d'association de la forme"""
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
         
+        fsizer.Add(self.label_chic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_nbchic = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_nbchic.Add(self.check_chic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
+        sizer_nbchic.Add(self.spin_nbchic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
+        fsizer.Add(sizer_nbchic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
+        fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
+        fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
+
         fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         sizer_chi = wx.BoxSizer(wx.HORIZONTAL)
         sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
         sizer_chi = wx.BoxSizer(wx.HORIZONTAL)
         sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
@@ -811,22 +834,36 @@ au chi2 d'association de la forme"""
         sizer_2.Fit(self)
         self.Layout()
         
         sizer_2.Fit(self)
         self.Layout()
         
-    def OnCheck1(self,event):
+    def OnCheck1(self, event):
         if self.check1.GetValue() :
             self.check2.SetValue(False)
         if self.check1.GetValue() :
             self.check2.SetValue(False)
+            self.check_chic.SetValue(False)
             self.spin_chi.Enable(False)
             self.spin_nb.Enable(True)
             self.spin_chi.Enable(False)
             self.spin_nb.Enable(True)
+            self.spin_nbchic.Enable(False)
         else : 
             self.spin_nb.Enable(False)
             
         else : 
             self.spin_nb.Enable(False)
             
-    def OnCheck2(self,event):
+    def OnCheck2(self, event):
         if self.check2.GetValue() :
         if self.check2.GetValue() :
-           self.check1.SetValue(False)
-           self.spin_nb.Enable(False)
-           self.spin_chi.Enable(True)
+            self.check1.SetValue(False)
+            self.check_chic.SetValue(False)
+            self.spin_chi.Enable(True)
+            self.spin_nb.Enable(False)
+            self.spin_nbchic.Enable(False)
         else :
            self.spin_chi.Enable(False) 
 
         else :
            self.spin_chi.Enable(False) 
 
+    def OnCheckChic(self, event) :
+        if self.check_chic.GetValue() :
+            self.check1.SetValue(False)
+            self.check2.SetValue(False)
+            self.spin_chi.Enable(False)
+            self.spin_nb.Enable(False)
+            self.spin_nbchic.Enable(True)
+        else :
+            self.spin_nbchic.Enable(False)
+
     def OnNorm(self, event):
         if not self.check4.GetValue() :
             self.spin_min.Disable()
     def OnNorm(self, event):
         if not self.check4.GetValue() :
             self.spin_min.Disable()
@@ -2550,6 +2587,21 @@ class PrefWordCloud ( wx.Dialog ):
         self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
         fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
         
         self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
         fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
         
+        self.typeformes = wx.StaticText( self, wx.ID_ANY, u"formes retenues", wx.DefaultPosition, wx.DefaultSize, 0 )
+        self.typeformes.Wrap( -1 )
+        fgSizer1.Add( self.typeformes, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        
+        typeformeschoiceChoices = [ u"actives", u"supplémentaires", u"actives et supplémentaires" ]
+        self.typeformeschoice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, typeformeschoiceChoices, 0 )
+        self.typeformeschoice.SetSelection( 0 )
+        fgSizer1.Add( self.typeformeschoice, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+        
+        self.m_staticline11 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        fgSizer1.Add( self.m_staticline11, 0, wx.EXPAND |wx.ALL, 5 )
+        
+        self.m_staticline12 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
+        fgSizer1.Add( self.m_staticline12, 0, wx.EXPAND |wx.ALL, 5 )        
+        
         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText6.Wrap( -1 )
         fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText6.Wrap( -1 )
         fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
@@ -2767,8 +2819,8 @@ class CorpusPref ( wx.Dialog ):
     def __init__( self, parent, parametres ):
         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Préférences", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
         self.parent = parent 
     def __init__( self, parent, parametres ):
         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Préférences", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
         self.parent = parent 
-        langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)']
-        self.langues = [u'french', u'english', u'german', 'italian', 'swedish', u'portuguese']
+        langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)', 'greek', 'other...']
+        self.langues = [u'french', u'english', u'german', 'italian', 'swedish', u'portuguese', 'greek', 'other']
         self.encodages = [enc[0].lower() for enc in encodages]
 
         ucimark = [u'****', u'0000']
         self.encodages = [enc[0].lower() for enc in encodages]
 
         ucimark = [u'****', u'0000']
@@ -2930,7 +2982,7 @@ class CorpusPref ( wx.Dialog ):
         self.check_ponct = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
         fgSizer3.Add( self.check_ponct, 0, wx.ALL, 5 )
 
         self.check_ponct = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
         fgSizer3.Add( self.check_ponct, 0, wx.ALL, 5 )
 
-        self.m_staticText16 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Pas d'espace entre deux formes (pour le chinois par exemple)", wx.DefaultPosition, wx.DefaultSize, 0 )
+        self.m_staticText16 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Pas d'espace entre deux formes", wx.DefaultPosition, wx.DefaultSize, 0 )
         self.m_staticText16.Wrap( -1 )
         fgSizer3.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
         
         self.m_staticText16.Wrap( -1 )
         fgSizer3.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )