+
+ if 'corpus_name' in pydata :
+ stat = menu.Append(wx.ID_ANY, _(u"Statistics").decode('utf8'))
+ spec = menu.Append(wx.ID_ANY, _(u"Specificities and CA").decode('utf8'))
+ classification = wx.Menu()
+ reinert = classification.Append(wx.ID_ANY, _(u"Reinert's Method").decode('utf8'))
+ #pam = classification.Append(wx.ID_ANY, u"Par matrice des distances")
+ menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), classification)
+ simi = menu.Append(wx.ID_ANY, _(u"Similarities Analysis").decode('utf8'))
+ wdc = menu.Append(wx.ID_ANY, _(u"WordCloud").decode('utf8'))
+ subcorpus = wx.Menu()
+ subcorpusfrommeta = subcorpus.Append(wx.ID_ANY, _(u'Sub corpus from metadata').decode('utf8'))
+ subcorpusfromtheme = subcorpus.Append(wx.ID_ANY, _(u'Sub corpus from thematic').decode('utf8'))
+ menu.AppendMenu(-1, _(u"Sub corpus").decode('utf8'), subcorpus)
+ menu.AppendSeparator()
+ self.Bind(wx.EVT_MENU, self.OnReinert, reinert)
+ #self.Bind(wx.EVT_MENU, self.OnPam, pam)
+ self.Bind(wx.EVT_MENU, self.OnStat, stat)
+ self.Bind(wx.EVT_MENU, self.OnSpec, spec)
+ self.Bind(wx.EVT_MENU, self.OnSimiTxt, simi)
+ self.Bind(wx.EVT_MENU, self.OnWordCloud, wdc)
+ self.Bind(wx.EVT_MENU, self.OnSubTextFromMeta, subcorpusfrommeta)
+ self.Bind(wx.EVT_MENU, self.OnSubTextFromTheme, subcorpusfromtheme)
+ elif 'matrix_name' in pydata :
+ for i in range(self.parent.matrix_menu.GetMenuItemCount()) :
+ item = self.parent.matrix_menu.FindItemByPosition(i)
+ itemid = item.GetId()
+ itemtext = item.GetText()
+ if item.IsSubMenu() :
+ nmenu = wx.Menu()
+ for val in item.GetSubMenu().GetMenuItems() :
+ nmenu.Append(val.GetId(), val.GetText())
+ menu.AppendMenu(itemid, itemtext, nmenu)
+ else :
+ menu.Append(itemid, itemtext)
+ split = wx.Menu()
+ splitfromvar = split.Append(-1, _(u"Split from variable").decode('utf8'))
+ menu.AppendMenu(-1, _(u"Split matrix").decode('utf8'), split)
+ self.Bind(wx.EVT_MENU, self.OnSplitFromVar, splitfromvar)
+ #print item, itemid, itemtext
+ #menu = self.parent.matrix_menu
+ #freq = menu.Append(wx.ID_ANY, _(u"Frequency").decode('utf8'))
+ #chi2 = menu.Append(wx.ID_ANY, _(u"Chi square").decode('utf8'))
+ #chdreinert = menu.Append(wx.ID_ANY, _(u"Reinert clustering").decode('utf8'))
+ #simi = menu.Append(wx.ID_ANY, _(u"Similarity analysis").decode('utf8'))
+ menu.AppendSeparator()
+ #self.Bind(wx.EVT_MENU, self.OnFreq, freq)
+ #self.Bind(wx.EVT_MENU, self.OnChiSquare, chi2)
+ #self.Bind(wx.EVT_MENU, self.OnSimiTab, simi)
+ #self.Bind(wx.EVT_MENU, self.OnCHDReinert, chdreinert)
+ elif pydata.get('type', False) == 'alceste' and pydata['uuid'] in self.parent.history.opened :
+ openmenu = wx.Menu()
+ antipro = openmenu.Append(wx.ID_ANY, _(u"Antiprofiles").decode('utf8'))
+ menu.AppendMenu(wx.ID_ANY, _(u"Open ...").decode('utf8'), openmenu)
+
+ profsr = menu.Append(wx.ID_ANY, _(u"Repeated segments profiles").decode('utf8'))
+ profgram = menu.Append(wx.ID_ANY, _(u"POS profiles").decode('utf8'))
+ tgen = menu.Append(wx.ID_ANY, _(u"Tgen Editor").decode('utf8'))
+ computetgen = menu.Append(wx.ID_ANY, _(u"Compute Tgen").decode('utf8'))
+ export_corpus = menu.Append(wx.ID_ANY, _(u"Export corpus").decode('utf8'))
+ colored = menu.Append(wx.ID_ANY, _(u"Colored corpus").decode('utf8'))
+ navig = menu.Append(wx.ID_ANY, _(u"Navigator").decode('utf8'))
+ statclasse = menu.Append(wx.ID_ANY, _(u"Clusters statistics").decode('utf8'))
+ rapport = menu.Append(wx.ID_ANY, _(u"Report").decode('utf8'))
+ export_classes = menu.Append(wx.ID_ANY, _(u"Export clusters").decode('utf8'))
+ subcorpusfromcl = menu.Append(wx.ID_ANY, _(u"Sub corpus from clusters").decode('utf8'))
+ menu.AppendSeparator()
+ self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro)
+ self.Bind(wx.EVT_MENU, self.OnProfSR, profsr)
+ self.Bind(wx.EVT_MENU, self.OnProfGram, profgram)
+ self.Bind(wx.EVT_MENU, self.OnTgenEditor, tgen)
+ self.Bind(wx.EVT_MENU, self.OnTgenCompute, computetgen)
+ 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)
+ self.Bind(wx.EVT_MENU, self.StatClasse, statclasse)
+ self.Bind(wx.EVT_MENU, self.OnRapport, rapport)
+ self.Bind(wx.EVT_MENU, self.OnExportClasses, export_classes)
+ self.Bind(wx.EVT_MENU, self.OnSubCorpusFromClusters, subcorpusfromcl)
+ elif pydata.get('type', False) == 'stat' and pydata['uuid'] in self.parent.history.opened :
+ export_dictionary = menu.Append(wx.ID_ANY, _(u"Export dictionary").decode('utf8'))
+ export_lems = menu.Append(wx.ID_ANY, _(u"Export lemma dictionary").decode('utf8'))
+ self.Bind(wx.EVT_MENU, self.OnExportDictionary, export_dictionary)
+ self.Bind(wx.EVT_MENU, self.OnExportLems, export_lems)
+ menu.AppendSeparator()
+ elif pydata.get('type', False) == 'spec' and pydata['uuid'] in self.parent.history.opened :
+ tgen = menu.Append(wx.ID_ANY, _(u"Tgen Editor").decode('utf8'))
+ computetgen = menu.Append(wx.ID_ANY, _(u"Compute Tgen").decode('utf8'))
+ self.Bind(wx.EVT_MENU, self.OnTgenEditor, tgen)
+ self.Bind(wx.EVT_MENU, self.OnTgenCompute, computetgen)
+ menu.AppendSeparator()
+ elif pydata.get('type', False) == 'reinertmatrix' and pydata['uuid'] in self.parent.history.opened :
+ openmenu = wx.Menu()
+ antipro = openmenu.Append(wx.ID_ANY, _(u"antiprofiles").decode('utf8'))
+ rapport = menu.Append(wx.ID_ANY, _(u"Report").decode('utf8'))
+ menu.AppendMenu(wx.ID_ANY, _(u"Open ...").decode('utf8'), openmenu)
+ self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro)
+ self.Bind(wx.EVT_MENU, self.OnRapport, rapport)
+
+
+ itemdelete = menu.Append(wx.ID_ANY, _(u"Delete from history").decode('utf8'))
+ #item11 = menu.Append(wx.ID_ANY, "Prepend An Item")
+ #item12 = menu.Append(wx.ID_ANY, "Append An Item")
+
+ #self.Bind(wx.EVT_MENU, self.OnItemBackground, item1)
+ #self.Bind(wx.EVT_MENU, self.OnItemForeground, item2)
+ #self.Bind(wx.EVT_MENU, self.OnItemBold, item3)
+ #self.Bind(wx.EVT_MENU, self.OnItemFont, item4)
+ #self.Bind(wx.EVT_MENU, self.OnItemHyperText, item5)
+ #self.Bind(wx.EVT_MENU, self.OnEnableWindow, item6)
+ #self.Bind(wx.EVT_MENU, self.OnDisableItem, item7)
+ #self.Bind(wx.EVT_MENU, self.OnItemIcons, item8)
+ self.Bind(wx.EVT_MENU, self.OnItemInfo, info)
+ self.Bind(wx.EVT_MENU, self.OnRename, rename)
+ self.Bind(wx.EVT_MENU, self.OnItemDelete, itemdelete)
+ #self.Bind(wx.EVT_MENU, self.OnItemPrepend, item11)
+ #self.Bind(wx.EVT_MENU, self.OnItemAppend, item12)