X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=OptionAlceste.py;h=3d52b4278b8ed65af63c1e5ee120e5761c0333a6;hp=6465e2953dd118cf1652c4f6b2716668675db885;hb=b19770356272772c8c8ba75f351520eca186bd19;hpb=9bde3d55d2131f1a33234a43c0de8b200ddb8f9a diff --git a/OptionAlceste.py b/OptionAlceste.py index 6465e29..3d52b42 100755 --- a/OptionAlceste.py +++ b/OptionAlceste.py @@ -20,19 +20,21 @@ class OptionAlc(wx.Dialog): self.DictPath = parametres['pathout'] self.AlcesteConf = parametres self.choose = False - - self.label_1 = wx.StaticText(self, -1, u"Lemmatisation") - self.radio_1 = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS) + self.svdmethod = ['svdR', 'irlba'] + if self.parent.pref.getboolean('iramuteq','libsvdc') : + self.svdmethod.append('svdlibc') + #self.label_1 = wx.StaticText(self, -1, u"Lemmatisation") + #self.radio_1 = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.label_12 = wx.StaticText(self, -1, u"Classification") - self.radio_box_2 = wx.RadioBox(self, -1, u"", choices=[u"double sur UC", u"simple sur UCE", u"simple sur UCI"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) #, u"simple sur UCE (non implemente)" - self.label_2 = wx.StaticText(self, -1, u"taille uc 1") + self.radio_box_2 = wx.RadioBox(self, -1, u"", choices=[u"double sur RST", u"simple sur segments de texte", u"simple sur textes"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) #, u"simple sur UCE (non implemente)" + self.label_2 = wx.StaticText(self, -1, u"taille rst 1") self.spin_ctrl_1 = wx.SpinCtrl(self, -1, "formes actives",size = (100,30), min=0, max=100) - self.label_3 = wx.StaticText(self, -1, u"taille uc 2") + self.label_3 = wx.StaticText(self, -1, u"taille rst 2") self.spin_ctrl_2 = wx.SpinCtrl(self, -1, "",size = (100,30), min=0, max=100) self.lab_nbcl = wx.StaticText(self, -1, u"nombre de classes terminales de la phase 1") self.spin_nbcl = wx.SpinCtrl(self, -1, "",size = (100,30), min=2, max=100) - txt = """Nombre minimum d'uce par classe + txt = """Nombre minimum de segments de texte par classe (0 = automatique)""" self.label_7 = wx.StaticText(self, -1, txt) self.spin_ctrl_4 = wx.SpinCtrl(self, -1, "",size = (100,30), min=0, max=1000) @@ -42,8 +44,12 @@ analysée (2 = automatique)""" self.spin_ctrl_5 = wx.SpinCtrl(self, -1, "",size = (100,30), min=2, max=1000) self.label_max_actives = wx.StaticText(self, -1, u"Nombre maximum de formes analysées") self.spin_max_actives = wx.SpinCtrl(self, -1, "",size = (100,30), min=20, max=10000) - self.label_4 = wx.StaticText(self, -1, u"Configuration \ndes clés d'analyse") - self.button_5 = wx.Button(self, wx.ID_PREFERENCES, "") + self.label_svd = wx.StaticText(self, -1, u"Méthode pour svd") + self.choicesvd = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.svdmethod, 0 ) + self.label_patate = wx.StaticText(self, -1, u"Mode patate (+ rapide, - précis)") + self.check_patate = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) + #self.label_4 = wx.StaticText(self, -1, u"Configuration \ndes clés d'analyse") + #self.button_5 = wx.Button(self, wx.ID_PREFERENCES, "") self.button_1 = wx.Button(self, wx.ID_CANCEL, "") self.button_2 = wx.Button(self, wx.ID_DEFAULT, u"Valeurs par défaut") self.button_4 = wx.Button(self, wx.ID_OK, "") @@ -52,18 +58,18 @@ analysée (2 = automatique)""" self.__set_properties() self.__do_layout() - self.Bind(wx.EVT_BUTTON, self.OnKeyPref, self.button_5) + #self.Bind(wx.EVT_BUTTON, self.OnKeyPref, self.button_5) self.Bind(wx.EVT_BUTTON, self.OnDef, self.button_2) def __set_properties(self): self.SetTitle("Options") #lang = self.AlcesteConf.get('ALCESTE', 'lang') #self.choice_dict.SetSelection(self.langues.index(lang)) - DefaultLem = self.parametres['lem'] - if DefaultLem : - self.radio_1.SetSelection(0) - else: - self.radio_1.SetSelection(1) + #DefaultLem = self.parametres['lem'] + #if DefaultLem : + # self.radio_1.SetSelection(0) + #else: + # self.radio_1.SetSelection(1) self.radio_box_2.SetSelection(int(self.parametres['classif_mode'])) self.spin_ctrl_1.SetValue(int(self.parametres['tailleuc1'])) self.spin_ctrl_2.SetValue(int(self.parametres['tailleuc2'])) @@ -72,6 +78,15 @@ analysée (2 = automatique)""" self.spin_ctrl_5.Disable() self.spin_max_actives.SetValue(int(self.parametres['max_actives'])) self.spin_nbcl.SetValue(int(self.parametres['nbcl_p1'])) + if 'svdmethod' in self.parametres : + self.choicesvd.SetSelection(self.svdmethod.index(self.parametres['svdmethod'])) + else : + self.choicesvd.SetSelection(1) + if 'mode.patate' in self.parametres : + self.check_patate.SetValue(self.parametres['mode.patate']) + else : + self.check_patate.SetValue(False) + def __do_layout(self): sizer_1 = wx.BoxSizer(wx.VERTICAL) @@ -82,10 +97,10 @@ analysée (2 = automatique)""" #grid_sizer2.Add(self.label_dict, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) #grid_sizer2.Add(self.choice_dict, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer2.Add(self.label_1, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer2.Add(self.radio_1, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer2.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.ALL, 1) - grid_sizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 1) + #grid_sizer2.Add(self.label_1, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) + #grid_sizer2.Add(self.radio_1, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) + #grid_sizer2.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.ALL, 1) + #grid_sizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 1) grid_sizer2.Add(self.label_12, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) grid_sizer2.Add(self.radio_box_2, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) @@ -122,8 +137,13 @@ analysée (2 = automatique)""" grid_sizer2.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.ALL, 1) grid_sizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 1) - grid_sizer2.Add(self.label_4, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) - grid_sizer2.Add(self.button_5, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) + grid_sizer2.Add(self.label_svd, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) + grid_sizer2.Add(self.choicesvd, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) + grid_sizer2.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.ALL, 1) + grid_sizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 1) + + grid_sizer2.Add(self.label_patate, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) + grid_sizer2.Add(self.check_patate, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 0) grid_sizer2.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.ALL, 1) grid_sizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.ALL, 1)