X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=textstat.py;h=ee0e4ef4ae7a10dd7892f3bda67789a0f9320dae;hp=09ec518011edf0270e60e78b7963d3bd34105afb;hb=3563d5ffbef160a381af784d9d8cce2ce26e11d9;hpb=e47f8c20e356631980624eb52d8476b3b86917c5;ds=sidebyside diff --git a/textstat.py b/textstat.py index 09ec518..ee0e4ef 100644 --- a/textstat.py +++ b/textstat.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- #Author: Pierre Ratinaud #Copyright (c) 2008-2012 Pierre Ratinaud -#Lisense: GNU/GPL +#License: GNU/GPL #from chemins import ConstructPathOut, StatTxtPathOut, ffr from chemins import PathOut @@ -65,13 +65,13 @@ class Stat(AnalyseText) : phapax_forme = (float(len(hapax)) / (float(len(formes)))) * 100 moy_occu_mot = float(occurrences) / float(len(formes)) txt = 'Globale\n' - txt += 'nombre d\'uci : %i\n' % len(self.corpus.ucis) + txt += 'nombre de textes : %i\n' % len(self.corpus.ucis) txt += 'nombre d\'occurrences : %i\n' % occurrences txt += 'nombre de formes : %i\n' % (len(formes)) txt += 'moyenne d\'occurrences par forme : %.2f\n' % moy_occu_mot txt += 'nombre d\'hapax : %i (%.2f%% des occurrences - %.2f%% des formes)\n' % (len(hapax), phapax, phapax_forme) print float(occurrences), float(len(self.corpus.ucis)) - txt += 'moyenne d\'occurrences par uci : %.2f' % (float(occurrences)/float(len(self.corpus.ucis))) + txt += 'moyenne d\'occurrences par texte : %.2f' % (float(occurrences)/float(len(self.corpus.ucis))) if self.dlg : self.dlg.Update(7, u'Ecriture...') self.result['glob'] = txt @@ -88,7 +88,7 @@ class Stat(AnalyseText) : """ % self.pathout['hapax.csv'] txt += """ open_file_graph("%s", width = 400, height = 400) - plot(log(tot[,1]), log = 'x', xlab='log(rangs)', ylab = 'log(frequences)', col = 'red', pch=16) + plot(tot[,1], log = 'xy', xlab='log(rangs)', ylab = 'log(frequences)', col = 'red', pch=16) dev.off() """ % (self.pathout['zipf.png']) tmpscript = tempfile.mktemp(dir=self.parent.TEMPDIR)