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)
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')
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()
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()
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
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'])
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')
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"))
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)
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)