From: pierre Date: Thu, 5 Sep 2024 15:44:19 +0000 (+0200) Subject: corrections X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=b655d2a94d97145cd734e17b883c4601c3e7963d;p=iramuteq corrections --- diff --git a/PrintRScript.py b/PrintRScript.py index e005361..86f4379 100755 --- a/PrintRScript.py +++ b/PrintRScript.py @@ -1343,7 +1343,7 @@ class TgenProfScript(PrintRScript): reslem <- build.prof.tgen(tgenlem) write.table(reslem$chi2, file = "%s", sep='\\t', col.names = NA) write.table(reslem$pchi2, file = "%s", sep='\\t', col.names = NA) - """ % (ffr(self.pathout['tgenlemchi2.csv']), ffr(self.pathout['tgenlempchi2.csv'])) + """ % (ffr(self.pathout['tgenlemchi2.csv']), ffr(self.pathout['tgenlempchi2.csv'])) self.add(txt) diff --git a/layout.py b/layout.py index 79f91e4..f85b878 100644 --- a/layout.py +++ b/layout.py @@ -698,7 +698,7 @@ class TgenLayout : parametres = self.page.parametres ira = wx.GetApp().GetTopWindow() tgenpath = os.path.join(parametres['pathout'], 'tgen.csv') - self.page.tgens, etoiles = ReadList(parametres['tgenspec'], ira.syscoding, sep="\t") + self.page.tgens, etoiles = ReadList(parametres['tgenspec'], 'utf8', sep="\t") tgen = TGen(path = tgenpath, encoding = 'UTF-8') tgen.read() tgenlempath = os.path.join(parametres['pathout'], 'tgenlemchi2.csv') diff --git a/listlex.py b/listlex.py index bee30db..d090937 100644 --- a/listlex.py +++ b/listlex.py @@ -234,7 +234,8 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor menu.Append(-1, _("Typical text segments"), menu_stcaract) #modifié menu.Append(self.onmaketgen, _("Make Tgen")) else : - menu.Append(self.id_tgendetails, _('Tgen details')) + if self.tgenlem : + menu.Append(self.id_tgendetails, _('Tgen details')) self.PopupMenu(menu) menu.Destroy() @@ -387,7 +388,10 @@ class ListForSpec(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSor ira = wx.GetApp().GetTopWindow() item=self.getColumnText(self.GetFirstSelected(), 0) wordlist = [val for val in self.tgens[item] if val in corpus.lems] + print(wordlist) wordlist = dict(list(zip(wordlist,wordlist))) + print(wordlist) + print(self.tgenlem) res = dict([[val, self.tgenlem[val]] for val in self.tgenlem if self.tgenlem[val][0] in wordlist]) win = ListLexFrame(self, ira, corpus, res, self.etoiles) win.Show() diff --git a/textaslexico.py b/textaslexico.py index 14f054b..2ed892a 100644 --- a/textaslexico.py +++ b/textaslexico.py @@ -23,7 +23,7 @@ import wx from chemins import ConstructPathOut, StatTxtPathOut, PathOut, ffr from analysetxt import AnalyseText from functions import exec_rcode, progressbar, check_Rresult, CreateIraFile, print_liste, treat_var_mod, write_tab, DoConf, TGen -from dialog import OptLexi #, StatDialog +from dialog import OptLexi #, StatDialog from PrintRScript import TgenSpecScript @@ -227,7 +227,7 @@ class TgenSpec(AnalyseText): self.doanalyse() def doanalyse(self): - self.tgen = TGen(path = self.parametres['tgenpath'], encoding = self.ira.syscoding) + self.tgen = TGen(path = self.parametres['tgenpath'], encoding = 'utf8') self.tgen.read(self.tgen.path) self.parametres['etoiles'].sort() tgenocc, totocc = self.corpus.make_tgen_table(self.tgen, self.parametres['etoiles']) diff --git a/textreinert.py b/textreinert.py index 12498ee..7e3a3bf 100644 --- a/textreinert.py +++ b/textreinert.py @@ -120,7 +120,7 @@ class TgenProf(AnalyseText): self.doanalyse() def doanalyse(self): - self.tgen = TGen(path = self.parametres['tgenpath'], encoding = self.ira.syscoding) + self.tgen = TGen(path = self.parametres['tgenpath'], encoding = 'utf8') self.tgen.read(self.tgen.path) #self.parametres['etoiles'].sort() self.parametres['tgeneff'] = os.path.join(self.parametres['pathout'], 'tgeneff.csv') diff --git a/tree.py b/tree.py index 39bee82..2fdd137 100755 --- a/tree.py +++ b/tree.py @@ -386,7 +386,7 @@ class LeftTree(CT.CustomTreeCtrl): stcaract = menu.Append(wx.ID_ANY, _("Typical text segments")) tgen = menu.Append(wx.ID_ANY, _("Tgen Editor")) computetgen = menu.Append(wx.ID_ANY, _("Compute Tgen")) - mergeclustergraph = menu.Append(wx.ID_ANY, _("Merge Cluster Graph")) + #mergeclustergraph = menu.Append(wx.ID_ANY, _("Merge Cluster Graph")) export_corpus = menu.Append(wx.ID_ANY, _("Export corpus")) colored = menu.Append(wx.ID_ANY, _("Colored corpus")) navig = menu.Append(wx.ID_ANY, _("Navigator")) @@ -402,7 +402,7 @@ class LeftTree(CT.CustomTreeCtrl): self.Bind(wx.EVT_MENU, self.OnStCaract, stcaract) self.Bind(wx.EVT_MENU, self.OnTgenEditor, tgen) self.Bind(wx.EVT_MENU, self.OnTgenCompute, computetgen) - self.Bind(wx.EVT_MENU, self.OnMergeClusterGraph, mergeclustergraph) + #self.Bind(wx.EVT_MENU, self.OnMergeClusterGraph, mergeclustergraph) self.Bind(wx.EVT_MENU, self.OnExportCorpus, export_corpus) self.Bind(wx.EVT_MENU, self.OnColored, colored) self.Bind(wx.EVT_MENU, self.OnNavig, navig) @@ -730,14 +730,14 @@ class LeftTree(CT.CustomTreeCtrl): def OnTgenCompute(self, evt): corpus = self.page.corpus - tgenpath = os.path.join(self.page.parametres['pathout'], 'tgen.csv') + tgenpath = os.path.join(self.page.parametres['pathout'], 'tgen.csv') if not os.path.exists(tgenpath) : - message = wx.MessageDialog(self.parent, _("No TGen yet !"), style = wx.ICON_EXCLAMATION | wx.OK) + message = wx.MessageDialog(self.parent, _("No TGen yet !"), style = wx.ICON_EXCLAMATION | wx.OK) message.ShowModal() message.Destroy() else : self.page.parametres['tgenpath'] = tgenpath - tgen = TGen(path = tgenpath, encoding = self.parent.syscoding) + tgen = TGen(path = tgenpath, encoding = 'utf8') if self.page.parametres['type'] == 'spec' : self.page.parametres['etoiles'] = self.page.etoiles TgenSpec(self.parent, corpus, self.page.parametres)