From f546f34af4443943a3f16e4be00c999c163060c2 Mon Sep 17 00:00:00 2001 From: Jean-Loup Beaussart Date: Tue, 3 Feb 2015 11:28:03 +0100 Subject: [PATCH] =?UTF-8?q?Questions=20termin=C3=A9es=20sauf=20la=20constr?= =?UTF-8?q?uction=20du=20dictionnaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- S2/TP2/tp2.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/S2/TP2/tp2.py b/S2/TP2/tp2.py index a5bc2ac..3cd21f0 100644 --- a/S2/TP2/tp2.py +++ b/S2/TP2/tp2.py @@ -379,14 +379,20 @@ def cle(mot): assert(type(mot) == str) - cpy = list(bas_casse_sans_accent(mot)).sort() + cpy = sort(bas_casse_sans_accent(mot)) - return str(cpy) + return cpy question(3) -ANAGRAMMES = {cle(i): anagrammes(i) for i in LEXIQUE} +ANAGRAMMES = dict() +l=list() + +for i in LEXIQUE: + k = cle(i) + + print(len(ANAGRAMMES)) @@ -417,8 +423,11 @@ section('Comparaison des deux méthodes') question(1) for i in range(30): - + print(len(anagrammes(i))) +for i in range(30): + print(len(anagrammes2(i))) + partie('Phrases d\'anagrammes') # Geoffrey