X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=analysetxt.py;h=201e1772c5fd2044f60caa12c9b569661309b113;hp=95fcfa2df03c2a250d235c828f7fc1f03422e404;hb=b4ab59a79dbc62d4234778e793c05718648c6775;hpb=54fef96ad151ba25920f3e589b39a83c3f62ae2c diff --git a/analysetxt.py b/analysetxt.py index 95fcfa2..201e177 100644 --- a/analysetxt.py +++ b/analysetxt.py @@ -5,7 +5,7 @@ import logging from chemins import PathOut -from functions import exec_rcode, check_Rresult, DoConf, ReadDicoAsDico +from functions import exec_rcode, check_Rresult, DoConf, ReadDicoAsDico, progressbar from shutil import copy from time import time, sleep from uuid import uuid4 @@ -50,6 +50,7 @@ class AnalyseText : if not self.parametres.get('dictionary', False) : 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']) @@ -57,6 +58,8 @@ class AnalyseText : copy(self.parametres['dictionary'], dictpath) self.parametres['dictionary'] = dictpath self.corpus.parse_active(gramact, gramsup) + if dlg : + self.dlg = progressbar(self.ira, dlg) result_analyse = self.doanalyse() if result_analyse is None : self.time = time() - self.t1 @@ -67,17 +70,22 @@ class AnalyseText : DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['Analyse.ira']) self.ira.history.add(self.parametres) if dlg : - dlg.Destroy() + if not isinstance(dlg, int) : + dlg.Destroy() + self.dlg.Destroy() OpenAnalyse(self.parent, self.parametres['ira']) self.ira.tree.AddAnalyse(self.parametres) self.val = 5100 else : self.val = False if dlg : - dlg.Destroy() + try : + self.dlg.Destroy() + except : + pass else : - if dlg : - dlg.Destroy() + #if isinstance(dlg, wx.ProgressDialog) : + # self.dlg.Destroy() self.val = False def doanalyse(self) : @@ -132,40 +140,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]