X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=analysetxt.py;h=f9b39738ea0c0f36bb14dc5d054fbe87e352cdf3;hp=cc9948200b6f5cd5f8f077ebb33f964bba55c777;hb=cbf4348fb7e7c5da42e3cb17c842afb4f7ea7a63;hpb=54bbc5135afebc8bcc00973fd25fae383f27bdf4 diff --git a/analysetxt.py b/analysetxt.py old mode 100644 new mode 100755 index cc99482..f9b3973 --- a/analysetxt.py +++ b/analysetxt.py @@ -23,6 +23,7 @@ class AnalyseText : self.dlg = dlg self.dialok = True self.parametres = parametres + #print(parametres) self.lemdial = lemdial self.val = False self.keys = DoConf(self.ira.ConfigPath['key']).getoptions() @@ -33,6 +34,7 @@ class AnalyseText : self.parametres = self.lemparam() if self.parametres is not None : self.parametres = self.make_config(parametres) + #print 'paramtre aprs make_config', self.parametres log.info(self.pathout.dirout) if self.parametres is not None : self.keys = DoConf(self.ira.ConfigPath['key']).getoptions() @@ -48,8 +50,10 @@ class AnalyseText : self.parametres['encoding'] = self.ira.syscoding self.t1 = time() if not self.parametres.get('dictionary', False) : + print self.parametres self.corpus.make_lems(lem=self.parametres['lem']) else : + print 'read new dico' dico = ReadDicoAsDico(self.parametres['dictionary']) self.corpus.make_lems_from_dict(dico, dolem=self.parametres['lem']) dictname = os.path.basename(self.parametres['dictionary']) @@ -63,7 +67,7 @@ class AnalyseText : if result_analyse is None : self.time = time() - self.t1 minutes, seconds = divmod(self.time, 60) - hours, minutes = divmod(minutes, 60) + hours, minutes = divmod(minutes, 60) self.parametres['time'] = '%.0fh %.0fm %.0fs' % (hours, minutes, seconds) self.parametres['ira'] = self.pathout['Analyse.ira'] DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['Analyse.ira']) @@ -94,26 +98,27 @@ class AnalyseText : if self.dlg and self.lemdial: dial = StatDialog(self.parent, self.keys) dial.CenterOnParent() + dial.corpus = self.corpus val = dial.ShowModal() if val == 5100 : if dial.radio_lem.GetSelection() == 0 : lem = 1 else : - lem = 0 + lem = 0 self.parametres['lem'] = lem if dial.radio_dictchoice.GetSelection() == 1 : - self.parametres['dictionary'] = dial.dictpath.GetValue() + self.parametres['dictionary'] = dial.dictpath.GetValue() dial.Destroy() return self.parametres else : dial.Destroy() - return None + return None else : return self.parametres def make_config(self, config) : if config is not None : - if not self.dlg : + if not self.dlg : return config else : return self.preferences() @@ -139,40 +144,3 @@ class AnalyseText : else : sleep(0.2) return check_Rresult(self.ira, pid) - - - - - - -# keys = {'art_def' : 2, -# 'pre' : 2, -# 'adj_dem' : 2, -# 'ono' : 2, -# 'pro_per' : 2, -# 'ver_sup' : 2, -# 'adv' : 1, -# 'ver' : 1, -# 'adj_ind' : 2, -# 'adj_pos' : 2, -# 'aux' : 2, -# 'adj_int' : 2, -# 'pro_ind' : 2, -# 'adj' : 1, -# 'pro_dem' : 2, -# 'nom' : 1, -# 'art_ind' : 2, -# 'pro_pos' : 2, -# 'nom_sup' : 2, -# 'adv_sup' : 2, -# 'adj_sup' : 2, -# 'adj_num' : 2, -# 'pro_rel' : 2, -# 'con' : 2, -# 'num' : 2, -# 'nr' : 1, -# 'sw' : 2, -# } -# -# gramact = [k for k in keys if keys[k] == 1] -# gramsup = [k for k in keys if keys[k] == 2]