From 0164603a44dcfc96639d69774b0cb247571f7f6e Mon Sep 17 00:00:00 2001 From: rsimonin Date: Sat, 13 Apr 2019 09:35:16 +0200 Subject: [PATCH] affichage --- arbre.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/arbre.c b/arbre.c index ee8cb9e..bef10a2 100644 --- a/arbre.c +++ b/arbre.c @@ -47,7 +47,7 @@ bool mot_existe(struct arbre *monarbre,char *mot,int i){ void ini_dico(struct dico *pt_dico) { - printf("ini_dico\n"); + printf("Initialisation du dictionnaire\n"); for(int i=0;ialpha[i]=NULL; } @@ -76,7 +76,7 @@ void ajout_mot(struct arbre **arbrecourant,char *mot,int i) creation_arbre(arbrecourant,mot[i]); } if(mot[i+1]=='\0'){ - printf("mot:%s %c\n",mot,mot[i]); + //printf("mot:%s %c\n",mot,mot[i]); (*arbrecourant)->finmot=true; } i++; @@ -164,53 +164,53 @@ void analyse_fichier(FILE *fp,Dico *pt_dico, int *nb_t, int *nb_f){ *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; - } +// 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