diff --git a/tree.c b/tree.c index 9a4b5c0..b9b992b 100644 --- a/tree.c +++ b/tree.c @@ -181,21 +181,32 @@ int find_mot(dico Dico, wchar_t mot[]) break; } } - if (fl == -1)return 1; + if (fl == -1){ + wprintf(mot); + wprintf(L"\n"); + return 1; + } } int taille = size(mot); if (taille == 1 && Dico.tab_ptr_tree[fl] != NULL) { - if (Dico.tab_ptr_tree[fl]->fin == 0)return 1; - else return 0; //vrais + if (Dico.tab_ptr_tree[fl]->fin == 0){ + wprintf(mot); + wprintf(L"\n"); + return 1; + }else return 0; //vrais } if (Dico.tab_ptr_tree[fl] == NULL)return 1; //faux struct node *ptr_node = Dico.tab_ptr_tree[fl]; for (int i = 1; i < taille; i++) { - if (ptr_node->nbr_fils == 0)return 1; + if (ptr_node->nbr_fils == 0){ + wprintf(mot); + wprintf(L"\n"); + return 1; + } for (int k = 0; k < (ptr_node->nbr_fils); k++) { if (ptr_node->fils[k]->val == mot[i]) @@ -203,13 +214,19 @@ int find_mot(dico Dico, wchar_t mot[]) ptr_node = ptr_node->fils[k]; break; } - else if (k + 1 == ptr_node->nbr_fils) + else if (k + 1 == ptr_node->nbr_fils){ + wprintf(mot); + wprintf(L"\n"); return 1; + } } } - if (ptr_node->fin == 0)return 1; - else return 0; + if (ptr_node->fin == 0){ + wprintf(mot); + wprintf(L"\n"); + return 1; + }else return 0; } //Test de présence de chaque mot du fichier de l'utilisateur @@ -218,6 +235,8 @@ int find_erreur(dico Dico, FILE *fp, wchar_t separateur[]) wchar_t val[3000]; int cpt_erreur = 0; + wprintf(L"Mots non reconnus :\n"); + while (fwscanf(fp, L"%ls", val) == 1) { toLowerCase(val);//Fichier mit en minuscule -- libgit2 0.21.2