X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=textstat.py;h=2618c51e1994fb8a99fb1fa7c95dee4a5b6a4def;hp=d14522f2e459615a586233339ff507b067cd04d4;hb=9d5358d31d7438dfa92c9112adb2ae471ad95aae;hpb=40ae5805c4286656d9c6c17e3231d0ea24cdcaa7;ds=sidebyside diff --git a/textstat.py b/textstat.py index d14522f..2618c51 100644 --- a/textstat.py +++ b/textstat.py @@ -31,20 +31,7 @@ class Stat(AnalyseText) : self.make_stats() def preferences(self) : - dial = StatDialog(self, self.parent) - dial.CenterOnParent() - val = dial.ShowModal() - if val == 5100 : - if dial.radio_lem.GetSelection() == 0 : - lem = 1 - else : - lem = 0 - self.parametres['lem'] = lem - dial.Destroy() - return self.parametres - else : - dial.Destroy() - return None + return self.parametres def make_stats(self): if self.dlg : @@ -94,12 +81,17 @@ class Stat(AnalyseText) : txt = """ source("%s") tot <- read.csv2("%s", header = FALSE, row.names = 1) - 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 += """ open_file_graph("%s", width = 400, height = 400) plot(log(tot[,1]), log = 'x', xlab='log(rangs)', ylab = 'log(frequences)', col = 'red', pch=16) dev.off() - """ % (self.parent.RscriptsPath['Rgraph'], self.pathout['total.csv'], self.pathout['hapax.csv'], self.pathout['zipf.png']) + """ % (self.pathout['zipf.png']) tmpscript = tempfile.mktemp(dir=self.parent.TEMPDIR) with open(tmpscript, 'w') as f : f.write(txt)