From b1e7a76f583a5715d025a9b896508969efa06c24 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 20 Mar 2013 14:23:46 +0100 Subject: [PATCH] ... --- corpus.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/corpus.py b/corpus.py index 0635f2a..cc3f2dc 100644 --- a/corpus.py +++ b/corpus.py @@ -510,6 +510,17 @@ class Corpus : table_uce[uces[uce]][i] = 1 table_uce.insert(0, list_act) return table_uce + + def make_pondtable_with_classe(self, uces, list_act) : + table_uce = [[0 for val in list_act] for line in range(0,len(uces))] + uces = dict([[uce, i] for i, uce in enumerate(uces)]) + for i, lem in enumerate(list_act) : + uceseff = self.getlemuceseff(lem) + lemuces = list(set(uceseff.keys()).intersection(uces)) + for uce in lemuces : + table_uce[uces[uce]][i] = uceseff[uce] + table_uce.insert(0, list_act) + return table_uce def parse_active(self, gramact, gramsup = None) : log.info('parse actives') -- 2.7.4