#from chemins import ConstructPathOut, StatTxtPathOut, ffr
from chemins import PathOut
#from chemins import ConstructPathOut, StatTxtPathOut, ffr
from chemins import PathOut
phapax_forme = (float(len(hapax)) / (float(len(formes)))) * 100
moy_occu_mot = float(occurrences) / float(len(formes))
txt = 'Globale\n'
phapax_forme = (float(len(hapax)) / (float(len(formes)))) * 100
moy_occu_mot = float(occurrences) / float(len(formes))
txt = 'Globale\n'
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 += '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))
if self.dlg :
self.dlg.Update(7, u'Ecriture...')
self.result['glob'] = txt
if self.dlg :
self.dlg.Update(7, u'Ecriture...')
self.result['glob'] = txt
- hapax <- read.csv2("%s", header = FALSE, row.names = 1)
- tot <- rbind(tot, hapax)
+ """ % (self.parent.RscriptsPath['Rgraph'], self.pathout['total.csv'])
+ if len(hapax) :
+ txt += """
+ hapax <- read.csv2("%s", header = FALSE, row.names = 1)
+ tot <- rbind(tot, hapax)
+ """ % self.pathout['hapax.csv']
+ txt += """
- 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)
tmpscript = tempfile.mktemp(dir=self.parent.TEMPDIR)
with open(tmpscript, 'w') as f :
f.write(txt)
tmpscript = tempfile.mktemp(dir=self.parent.TEMPDIR)
with open(tmpscript, 'w') as f :
f.write(txt)
else :
with open(self.pathout['%s.txt' % 'glob'], 'w') as f :
f.write(self.result['glob'].encode(self.parent.syscoding))
else :
with open(self.pathout['%s.txt' % 'glob'], 'w') as f :
f.write(self.result['glob'].encode(self.parent.syscoding))
- self.parametres['pathout'] = self.pathout['Analyse.ira']
- DoConf().makeoptions(['stat'],[self.parametres], self.pathout['Analyse.ira'])
+ #self.parametres['pathout'] = self.pathout['Analyse.ira']
+ #DoConf().makeoptions(['stat'],[self.parametres], self.pathout['Analyse.ira'])