+ return table_assoc, table_rank
+
+ def makedatas(self, table_assoc, table_rank) :
+ words = {}
+ for i in range(0, len(table_assoc)) :
+ for j, word in enumerate(table_assoc[i]) :
+ if word.strip() != "" :
+ if word in words :
+ words[word][0] += 1
+ if table_rank[i][j] != '' :
+ words[word][1].append(float(table_rank[i][j]))
+ else :
+ if table_rank[i][j] != '' :
+ words[word] = [1, [float(table_rank[i][j])]]
+ else :
+ words[word] = [1, []]
+ res = [[word, words[word][0], float(sum(words[word][1])) / len(words[word][1])] for word in words if len(words[word][1]) != 0 and words[word][0] >= self.parametres['freqmin']]
+ with open(self.pathout['table.csv'], 'w') as f :
+ f.write('\n'.join(['\t'.join(['"' + val[0] +'"', `val[1]`, `val[2]`]) for val in res]))
+ #self.parent.tableau.parametres = self.parent.tableau.parametre
+ #self.parent.tableau.save_tableau(self.pathout['analyse.db'])
+
+ def DoR(self) :
+ script = ProtoScript(self)
+ script.make_script()
+ self.doR(script.scriptout)