X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=ProfList.py;h=6b553e91068414fb1b887ce71b319ca8f101583b;hp=da8d316e3a843de81b1ff89f31429135348c6095;hb=b4ab59a79dbc62d4234778e793c05718648c6775;hpb=596a38917a39d67e811cf5eff31a3921fa3ce452 diff --git a/ProfList.py b/ProfList.py index da8d316..6b553e9 100644 --- a/ProfList.py +++ b/ProfList.py @@ -31,12 +31,13 @@ from copy import copy #--------------------------------------------------------------------------- class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.ColumnSorterMixin): - def __init__(self, parent, gparent, profclasse, Alceste=False, cl=0): + def __init__(self, parent, gparent, profclasse, Alceste=False, cl=0, translation = False): wx.ListCtrl.__init__( self, parent, -1, style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_HRULES|wx.LC_VRULES) self.parent = parent self.Alceste = Alceste self.Source = gparent + self.translation = translation self.cl = cl self.var_mod = {} self.them_mod = {} @@ -714,7 +715,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col vchistable = [line[1:] for line in chistable] fchistable = [line[0] for line in chistable] words = self.getselectedwords() - tableout = [vchistable[fchistable.index(word)] for word in words] + tableout = [vchistable[fchistable.index(self.getword(word))] for word in words] tmpgraph = tempfile.mktemp(dir=self.Source.parent.TEMPDIR) nbcl = len(title) nbwords = len(words) @@ -733,9 +734,15 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col vchistable = [line[1:] for line in chistable] fchistable = [line[0] for line in chistable] words = self.getselectedwords() - tableout = [vchistable[fchistable.index(word)] for word in words] + tableout = [vchistable[fchistable.index(self.getword(word))] for word in words] BarFrame(self.Source.parent, tableout, title, words, tree = self.Source.pathout['Rdendro']) + def getword(self, word) : + if self.translation : + return self.lems[word] + else : + return word + def make_concord(self, uces, title, color = 'red') : corpus = self.Source.corpus ListWord = [self.getColumnText(self.GetFirstSelected(), 6)] @@ -744,6 +751,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col last = self.GetNextSelected(last) ListWord.append(self.getColumnText(last, 6)) ucef = [] + ListWord = [self.getword(word) for word in ListWord] if self.Source.parametres['classif_mode'] != 2 : for word in ListWord : uci = False @@ -811,6 +819,7 @@ class ProfListctrlPanel(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Col #print 'ATTENTION PRINT ET TABLE' #corpus.make_et_table() word = self.getColumnText(self.GetFirstSelected(), 6) + word = self.getword(word) lems = corpus.getlems() uces = corpus.lc[self.cl-1] rep = []