From fde8b39d50caa9a446ff9f3bfb6878de1b02cd7e Mon Sep 17 00:00:00 2001 From: rsSimonin Date: Tue, 23 Apr 2019 09:58:23 +0200 Subject: [PATCH] fini --- arbre.c | 67 ++----------------------------------------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/arbre.c b/arbre.c index f7c7ad8..de2d208 100644 --- a/arbre.c +++ b/arbre.c @@ -2,20 +2,9 @@ #include #include #include -#define TAILLE 27 -//#include "arbre.h" - -typedef struct arbre{ - char val; - struct arbre *suite[TAILLE]; - bool finmot; //1 si fin de mot -}Arbre; - -typedef struct dico { - Arbre *alpha[TAILLE]; -}Dico; +#include "arbre.h" @@ -119,7 +108,7 @@ void free_dico(struct dico *pt_dico) free_arbre((pt_dico->alpha[i])); } - free(pt_dico); + //free(pt_dico); } void affiche_arbre(struct arbre *arbre) @@ -147,7 +136,6 @@ void affiche_dico(struct dico *dico) } - void analyse_fichier(FILE *fp,Dico *pt_dico, int *nb_t, int *nb_f){ int nbmot_t=0; int nbmot_f=0; @@ -163,54 +151,3 @@ void analyse_fichier(FILE *fp,Dico *pt_dico, int *nb_t, int *nb_f){ *nb_t=nbmot_t; *nb_f=nbmot_f; } - -// int main (int argc,char *argv[]){ -// FILE* dico = NULL; -// if(argc >1){ -// printf("chargement de votre dictionnaire \n"); -// dico=fopen(argv[1],"r"); -// } -// // else dico=fopen("words-no-accents","r"); -// -// if(dico == NULL){ -// // return EXIT_FAILURE; -// printf("chargement du dictionnaire par default"); -// dico=fopen("words-no-accents","r"); -// } //File is not readable -// -// struct dico *mondico=malloc(sizeof(struct dico)); -// charger_dico(dico,&mondico); -// // affiche_dico(mondico); -// fclose(dico); -// char mot[]="zombie"; -// char mot2[]="chaine"; -// // mot_existe(mondico->alpha[calculcase('r')],"rerere",0); -// //mot_existe(mondico->alpha[calculcase(mot2[0])],mot2,0); -// -// printf("1: %s:%d \n",mot,mot_existe(mondico->alpha[calculcase(mot[0])],mot,0)); -// printf("2: %s:%d \n",mot2,mot_existe(mondico->alpha[calculcase(mot2[0])],mot2,0)); -// -// FILE* fichier_utilisateur = NULL; -// if(argc >2){ -// printf("Analyse de votre fichier \n"); -// fichier_utilisateur=fopen(argv[2],"r"); -// printf("Fin Analyse de votre fichier \n"); -// } -// -// if (fichier_utilisateur!=NULL){ -// printf("analyse en cours\n"); -// int juste=0; -// int faux=0; -// analyse_fichier(fichier_utilisateur,mondico,&juste,&faux); -// printf("juste:%d \n",juste); -// printf("faux:%d \n",faux); -// } -// -// printf("fin programme \n"); -// free_dico(mondico); -// if (fichier_utilisateur!=NULL){ -// fclose(fichier_utilisateur); -// } -// -// return 0; -// } -- libgit2 0.21.2