From: Pierre Date: Sat, 9 Feb 2013 13:43:50 +0000 (+0100) Subject: layout X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=a215187924e98a385f5d481bbb2e9f4b8804aba3;p=iramuteq layout --- diff --git a/layout.py b/layout.py index 3a670e5..69381d4 100644 --- a/layout.py +++ b/layout.py @@ -514,7 +514,7 @@ def PrintRapport(self, corpus, parametres, istxt = True): txt += u'nombre de formes actives: %i%s' % (corpus.getactivesnb(1), sep) txt += u'nombre de formes supplémentaires: %i%s' % (corpus.getactivesnb(2), sep) txt += u'nombre de formes actives de fréquence >= %i: %i%s' % (parametres['eff_min_forme'], parametres['nbactives'], sep) - txt += u'moyenne d\'occurrences par uce :%f%s' % (float(totocc) / float(corpus.getucenb()), sep) + txt += u'moyenne d\'occurrences par segments :%f%s' % (float(totocc) / float(corpus.getucenb()), sep) if 'tailleuc1' in parametres : if parametres['classif_mode'] == 0 : txt += u'taille rst1 / rst2: %i / %i - %i / %i%s' % (parametres['tailleuc1'], parametres['tailleuc2'], parametres['lenuc1'], parametres['lenuc2'], sep) @@ -529,7 +529,7 @@ def PrintRapport(self, corpus, parametres, istxt = True): elif self.parametres['classif_mode'] == 2 : txt += u'%i textes classés sur %i (%.2f%%)%s' % (sum([len(cl) for cl in corpus.lc]), corpus.getucinb(), (float(sum([len(cl) for cl in corpus.lc]))) / float(corpus.getucinb()) * 100, sep) else : - txt += u'%i uce classées sur %i (%.2f%%)%s' % (self.ucecla, self.Ucenb, (float(self.ucecla) / float(self.Ucenb)) * 100, sep) + txt += u'%i segments classées sur %i (%.2f%%)%s' % (self.ucecla, self.Ucenb, (float(self.ucecla) / float(self.Ucenb)) * 100, sep) txt += """ ########################### diff --git a/listlex.py b/listlex.py index b4e1b59..9ead606 100644 --- a/listlex.py +++ b/listlex.py @@ -21,7 +21,7 @@ import tempfile from functions import exec_rcode, MessageImage from chemins import ffr from PrintRScript import barplot -from dialog import SearchDial +from dialog import SearchDial, message #--------------------------------------------------------------------------- #class List(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): @@ -192,7 +192,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor rep = [] for forme in lems[word].formes : rep.append([corpus.getforme(forme).forme, corpus.getforme(forme).freq]) - win = message(self, -1, u"Formes associées", size=(300, 200), style=wx.DEFAULT_FRAME_STYLE) + win = message(self, u"Formes associées", (300, 200)) win.html = '\n' + '
'.join([' : '.join([str(val) for val in forme]) for forme in rep]) + '\n' win.HtmlPage.SetPage(win.html) win.Show(True) @@ -202,7 +202,7 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor page = self.parent.nb.GetPage(activenotebook) item=self.getColumnText(self.GetFirstSelected(), 0) corpus = page.corpus - win = message(self, -1, u"Concordancier", size=(600, 200),style = wx.DEFAULT_FRAME_STYLE) + win = message(self, u"Concordancier", (750, 600)) avap=60 listmot = corpus.getlems()[item].formes uce_ok = corpus.getlemuces(item) @@ -284,38 +284,38 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor -class message(wx.Frame): - def __init__(self, *args, **kwds): - # begin wxGlade: MyFrame.__init__ - kwds["style"] = wx.DEFAULT_FRAME_STYLE - wx.Frame.__init__(self, *args, **kwds) - #self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE) - self.HtmlPage=wx.html.HtmlWindow(self, -1) - if "gtk2" in wx.PlatformInfo: - self.HtmlPage.SetStandardFonts() - self.HtmlPage.SetFonts('Courier','Courier') - - - self.button_1 = wx.Button(self, -1, "Fermer") - self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1) - self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) - self.__do_layout() - # end wxGlade - - def __do_layout(self): - # begin wxGlade: MyFrame.__do_layout - sizer_1 = wx.BoxSizer(wx.VERTICAL) - sizer_2 = wx.BoxSizer(wx.VERTICAL) - sizer_2.Add(self.HtmlPage, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) - sizer_2.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0) - sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) - self.SetAutoLayout(True) - self.SetSizer(sizer_1) - self.Layout() - # end wxGlade - - def OnCloseMe(self, event): - self.Close(True) - - def OnCloseWindow(self, event): - self.Destroy() +#class message(wx.Frame): +# def __init__(self, *args, **kwds): +# # begin wxGlade: MyFrame.__init__ +# kwds["style"] = wx.DEFAULT_FRAME_STYLE +# wx.Frame.__init__(self, *args, **kwds) +# #self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE) +# self.HtmlPage=wx.html.HtmlWindow(self, -1) +# if "gtk2" in wx.PlatformInfo: +# self.HtmlPage.SetStandardFonts() +# self.HtmlPage.SetFonts('Courier','Courier') +# +# +# self.button_1 = wx.Button(self, -1, "Fermer") +# self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1) +# self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) +# self.__do_layout() +# # end wxGlade +# +# def __do_layout(self): +# # begin wxGlade: MyFrame.__do_layout +# sizer_1 = wx.BoxSizer(wx.VERTICAL) +# sizer_2 = wx.BoxSizer(wx.VERTICAL) +# sizer_2.Add(self.HtmlPage, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0) +# sizer_2.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0) +# sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) +# self.SetAutoLayout(True) +# self.SetSizer(sizer_1) +# self.Layout() +# # end wxGlade +# +# def OnCloseMe(self, event): +# self.Close(True) +# +# def OnCloseWindow(self, event): +# self.Destroy() diff --git a/parse_factiva_mail.py b/parse_factiva_mail.py index 50e4510..e73d510 100644 --- a/parse_factiva_mail.py +++ b/parse_factiva_mail.py @@ -65,13 +65,3 @@ class ParseFactivaMail : content = infile.read() #lecture du fichier ucis = parsetxtmail(content) print_ucis(ucis, outf, encodage_out) - -#for dat in ['2001','2002','2003','2004', '2005','2006','2007','2008','2009','2010','2011'] : -# path = os.path.join(txtdir,dat) -# outfile = os.path.join(txtdir, 'corpus_' + dat + '.txt') -# doparse(path, outfile) - - -if __name__ == '__main__' : - doparse(txtdir, fileout, encodage_in, encodage_out) - print 'fini'