self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self)
self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick, self)
+ self.Bind(wx.EVT_LIST_ITEM_ACTIVATED , self.OnPopupTwo, self)
# for wxMSW
self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)
# -*- coding: utf-8 -*-
#Author: Pierre Ratinaud
#Copyright (c) 2008-2011 Pierre Ratinaud
-#Lisense: GNU/GPL
+#License: GNU/GPL
import tempfile
from chemins import ffr
xyminmax <- PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=1, fin=(debsup-1), xlab = xlab, ylab = ylab)
""" % (DictChdTxtOut['AFC2DL_OUT'])
txt += """
- PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debsup, fin=(debet-1), xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2])
+ PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debsup, fin=(debet-1), xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2], active=FALSE)
""" % (DictChdTxtOut['AFC2DSL_OUT'])
txt += """
if ((fin - debet) > 2) {
- PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debet, fin=fin, xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2])
+ PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=debet, fin=fin, xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2], active = FALSE)
}
""" % (DictChdTxtOut['AFC2DEL_OUT'])
txt += """
- PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", col=TRUE, what='coord', xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2])
+ PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", col=TRUE, what='coord', xlab = xlab, ylab = ylab, xmin = xyminmax$xminmax[1], xmax = xyminmax$xminmax[2], ymin = xyminmax$yminmax[1], ymax = xyminmax$yminmax[2], active=FALSE)
""" % (DictChdTxtOut['AFC2DCL_OUT'])
# txt += """
# PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='crl', deb=1, fin=(debsup-1), xlab = xlab, ylab = ylab)
if self.parametres['type_graph'] == 2 : type = 'rgl'
if self.parametres['type_graph'] == 3 :
graphnb = 1
+ type = 'web'
+ dirout = os.path.dirname(self.pathout['mat01'])
+ while os.path.exists(os.path.join(dirout,'web_'+str(graphnb))):
+ graphnb +=1
+ self.filename = ffr(os.path.join(dirout,'web_'+str(graphnb)))
+ os.mkdir(self.filename)
+ self.filename = os.path.join(self.filename, 'gexf.gexf')
+ if self.parametres['type_graph'] == 4 :
+ graphnb = 1
type = 'rglweb'
dirout = os.path.dirname(self.pathout['mat01'])
while os.path.exists(os.path.join(dirout,'webrgl_'+str(graphnb))):
vertex.size <- NULL
"""
else :
- print self.parametres
+ #print self.parametres
if (self.parametres['type'] == 'clustersimitxt' and self.parametres.get('tmpchi', False)) or (self.parametres['type'] == 'simimatrix' and 'tmpchi' in self.parametres):
txt += """
lchi <- read.table("%s")
#events
#self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
- #self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
+ self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnPopupTwo, self)
#self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected)
self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick)
#for searching
search_id = wx.NewId()
searchall_id = wx.NewId()
+ concord_id = wx.NewId()
self.parent.Bind(wx.EVT_MENU, self.onsearch, id = search_id)
self.parent.Bind(wx.EVT_MENU, self.onsearchall, id = searchall_id)
self.accel_tbl = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord('F'), search_id),
def onexport(self, evt) :
if 'corpus' in dir(self.Source):
corpus = self.Source.corpus
- corpus.export_classe(self.Source.pathout['classe_%i_export.txt' % self.cl], self.cl)
+ if self.Source.parametres['classif_mode'] != 2 :
+ uci = False
+ else :
+ uci = True
+ corpus.export_classe(self.Source.pathout['classe_%i_export.txt' % self.cl], self.cl, uci = uci)
dial = wx.MessageDialog(self, self.Source.pathout['classe_%i_export.txt' % self.cl], u"Export", wx.OK|wx.ICON_INFORMATION)
dial.ShowModal()
dial.Destroy()
dlg = progressbar(self, 2)
corpus = self.Source.corpus
uces = corpus.lc[self.cl-1]
+ if self.Source.parametres['classif_mode'] != 2 :
+ uci = False
+ else :
+ uci = True
l = []
dlg.Update(1, u'Segments...')
for i in range(2,10) :
- li = corpus.find_segments_in_classe(uces, i, 1000)
+ li = corpus.find_segments_in_classe(uces, i, 1000, uci = uci)
if li == [] :
break
else :
dlg = progressbar(self,maxi = 4)
corpus = self.Source.corpus
uces = corpus.lc[self.cl-1]
- tab = corpus.make_table_with_classe(uces, self.la)
+ if self.Source.parametres['classif_mode'] != 2 :
+ uci = False
+ else :
+ uci = True
+ tab = corpus.make_table_with_classe(uces, self.la, uci = uci)
tab.pop(0)
dlg.Update(2, u'score...')
if atype == 0 :
ntab2 = ntab2[:limite]
nuces = [val[1] for val in ntab2]
dlg.Update(3, u'concordancier...')
- ucis_txt, ucestxt = doconcorde(corpus, nuces, self.la)
+ ucis_txt, ucestxt = doconcorde(corpus, nuces, self.la, uci = uci)
dlg.Update(4, u'texte...')
win = message(self, u"Segments de texte caractéristiques - Classe %i" % self.cl, (750, 600))
win.html = '<html>\n' + '<br>'.join(['<br>'.join([ucis_txt[i], '<table bgcolor = #1BF0F7 border=0><tr><td><b>score : %.2f</b></td></tr></table>' % ntab2[i][0], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n</html>'
win.HtmlPage.SetPage(txt)
win.Show(True)
-
def make_concord(self, uces, title, color = 'red') :
corpus = self.Source.corpus
ListWord = [self.getColumnText(self.GetFirstSelected(), 6)]
last = self.GetNextSelected(last)
ListWord.append(self.getColumnText(last, 6))
ucef = []
- for word in ListWord :
- ucef += list(set(corpus.getlemuces(word)).intersection(uces))
- ucis_txt, ucestxt = doconcorde(corpus, ucef, ListWord)
+ if self.Source.parametres['classif_mode'] != 2 :
+ for word in ListWord :
+ uci = False
+ ucef += list(set(corpus.getlemuces(word)).intersection(uces))
+ else :
+ for word in ListWord :
+ ucef += list(set(corpus.getlemucis(word)).intersection(uces))
+ uci = True
+ ucis_txt, ucestxt = doconcorde(corpus, ucef, ListWord, uci = uci)
win = message(self, title, size=(750, 600))
win.html = ('<html>\n<h1>%s</h1>' % ' '.join(ListWord)) + '<br>'.join(['<br>'.join([ucis_txt[i], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n</html>'
win.HtmlPage.SetPage(win.html)
rep = []
#FIXME : donner aussi eff reel a la place de nb uce
for forme in lems[word].formes :
- ucef = list(set(corpus.getworduces(forme)).intersection(uces))
+ if self.Source.parametres['classif_mode'] != 2 :
+ ucef = list(set(corpus.getworduces(forme)).intersection(uces))
+ else :
+ ucef = list(set(corpus.getworducis(forme)).intersection(uces))
#ucef = [uce for uce in corpus.formes[forme][1] if uce in uces]
if ucef != [] :
nb = len(ucef)
# -*- coding: utf-8 -*-
#Author: Pierre Ratinaud
#Copyright (c) 2008-2012, Pierre Ratinaud
-#Lisense: GNU GPL
+#License: GNU GPL
from optparse import OptionParser
#------------------------------------
import wx
#import wx.aui
-if wx.__version__ >= '2.11' :
- import wx.lib.agw.aui as aui
-else :
- import aui
+import wx.lib.agw.aui as aui
import wx.html
import wx.grid
import wx.lib.hyperlink as hl
from checkversion import NewVersion
from guifunct import *
from tableau import Tableau
-from dialog import PrefDialog, EncodeDialog, CorpusPref
+from dialog import PrefDialog, CorpusPref
from tabfrequence import Frequences
from tabchi2 import ChiSquare
#from tabstudent import MakeStudent
from textaslexico import Lexico
from textsimi import SimiTxt, SimiFromCluster
from textwordcloud import WordCloud, ClusterCloud
-from profile_segment import ProfileSegment
+#from profile_segment import ProfileSegment
#from textcheckcorpus import checkcorpus
from openanalyse import OpenAnalyse
-from corpus import BuildFromAlceste, Builder
+from corpus import Builder
from sheet import MySheet
from checkinstall import CreateIraDirectory, CheckRPath, FindRPAthWin32, FindRPathNix, CheckRPackages, IsNew, UpgradeConf, CopyConf, RLibsAreInstalled
from chemins import RscriptsPath, ConstructConfigPath, ConstructDicoPath, ConstructGlobalPath, PathOut
# f.write('')
self.history = History(os.path.join(UserConfigPath, 'history.db'))
self.tree = LeftTree(self)
- self._mgr.AddPane(self.tree, aui.AuiPaneInfo().Name("lefttree").Caption("Navigateur").
+ self._mgr.AddPane(self.tree, aui.AuiPaneInfo().Name("lefttree").Caption(_(u"Navigator").decode('utf8')).
Left().MinSize(wx.Size(200,500)).Layer(1).Position(1).CloseButton(False).MaximizeButton(True).
MinimizeButton(True))
dlg = wx.MessageDialog(self, msg, u"Problème de configuration", wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING)
dlg.CenterOnParent()
if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
- evt.Veto()
+ pass
dlg.Destroy()
dlg = wx.MessageDialog(self, u"Installation OK", u"Installation", wx.OK | wx.ICON_INFORMATION)
dlg.CenterOnParent()
if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
- evt.Veto()
+ evt.Veto()
def DisEnSaveTabAs(self, DISEN):
#Disable SaveTabAs
inputname, self.input_path = OnOpen(self, "Texte")
self.filename = self.input_path[0]
if inputname:
- self.OpenText()
+ self.OpenText()
def OnViewData(self, event):
print self.type
self._mgr.Update()
def OpenText(self):
- #dial = EncodeDialog(self)
dlg = wx.ProgressDialog("Ouverture...",
"Veuillez patienter...",
maximum=2,
elif True in ListFile :
remove = True
if remove:
- del self.DictTab[TabTitle]
+ del self.DictTab[TabTitle]
else :
self.LastTabClose()
else :
self.res = DoSimi(self, param = None)
#self.res = Verges(self)
if self.res.val == wx.ID_OK :
- PlaySound(self)
+ PlaySound(self)
except :
BugReport(self)
#################################################################
class IntroPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
- #col = randint(0, 255)
- #col1 = randint(0,255)
- #col2 = randint(0,255)
- col = 0
- bckgrdcolor = wx.Colour(col, col, col)
+ col = randint(0, 255)
+ col1 = randint(0,255)
+ col2 = randint(0,255)
+ col = 57
+ bckgrdcolor = wx.Colour(col, col1, col2)
self.SetBackgroundColour(bckgrdcolor)
txtcolour = wx.Colour(250, 250, 250)
linkcolor = wx.Colour(255, 0, 0)
self.hyper_lerass.UpdateLink()
blank = wx.StaticText(PanelPres, -1, u'\n')
blank1 = wx.StaticText(PanelPres, -1, u'\n')
- labellicence = wx.StaticText(PanelPres, -1, u'Licence GNU GPL')
+ labellicence = wx.StaticText(PanelPres, -1, _(u"License GNU GPL").decode('utf8'))
labellicence.SetForegroundColour(txtcolour)
labellicence.SetBackgroundColour(bckgrdcolor)
labelcopy = wx.StaticText(PanelPres, -1, ConfigGlob.get('DEFAULT', 'copyright'))
win = message(self, u"Segments de texte caractéristiques - %s" % self.first[ind], (750, 600))
win.html = '<html>\n' + '<br>'.join(['<br>'.join([ucis_txt[i], '<table bgcolor = #1BF0F7 border=0><tr><td><b>score : %.2f</b></td></tr></table>' % ntab2[i][0], ucestxt[i]]) for i in range(0,len(ucestxt))]) + '\n</html>'
win.HtmlPage.SetPage(win.html)
- #dlg.Destroy()
win.Show(True)
def OnPopupTwo(self, event):