diff --git a/projetfinalaccent2.c b/projetfinalaccent2.c index 54461cd..21b699f 100644 --- a/projetfinalaccent2.c +++ b/projetfinalaccent2.c @@ -3,7 +3,7 @@ #include #include -#define A 259 +#define A 256 struct node { wchar_t lettre; @@ -40,17 +40,17 @@ struct cell ** insertion(wchar_t elem, struct cell** pL) { void initialisation_tab_arbre(struct node tab[]) { int i = 0; - for(wchar_t u = 'a'; u < A-3; u++) { + for(wchar_t u = 'a'; u < A; u++) { tab[i].lettre = u; //ajout lettres minuscules tab[i].listeFils = NULL; i++; } - tab[A-3].lettre = '?'; - tab[A-2].lettre = '!'; - tab[A-1].lettre = '\''; - for(int j = 1; j <= 3; j++) { //Ajout des caractères de ponctuation par défaut - tab[A-j].listeFils = NULL; - insertion('\0', &(tab[A-j].listeFils)); + tab[i].lettre = '?'; + tab[i+1].lettre = '!'; + tab[i+2].lettre = '0'; + for(int j = 0; j <= 2; j++) { //Ajout des caractères de ponctuation par défaut + tab[i+j].listeFils = NULL; + insertion('\0', &(tab[i+j].listeFils)); } } @@ -204,11 +204,8 @@ void correction_mot(struct node tab_arbre_prcp[]) { void desalocationArbre(struct cell** pL) { - if ((*pL) == NULL) { - printf("return arbre desaloc"); - return; - } - + if ((*pL) == NULL) return; + desalocationArbre(&(*pL)-> arbreSuivant); desalocationArbre(&(*pL)-> arbre -> listeFils); free((*pL) -> arbre); @@ -219,7 +216,6 @@ void desalocationTableauArbre(struct node tab_arbre[]){ int i = 0; for(wchar_t u = 'a'; u < A; u++) { desalocationArbre(&tab_arbre[i].listeFils); - if(u>=A-4) printf("pas segfault : i = %d", i+1); i++; } } @@ -245,8 +241,8 @@ int main(int argc, char* argv[]) { return 1; } initialisation_tab_arbre(tab_arbre); - remplir_dico(dico, tab_arbre); //on suppose qu'il n'y a pas d'accents dans le dictionnaire - for(int i = 0; i < A; i++) wprintf(L"%lc\n", tab_arbre[i].lettre); + remplir_dico(dico, tab_arbre); + //for(int i = 0; i < A; i++) wprintf(L"%lc\n", tab_arbre[i].lettre); correction_txt(txt, tab_arbre); correction_mot(tab_arbre); desalocationTableauArbre(tab_arbre); diff --git a/projetfinalaccent2.exe b/projetfinalaccent2.exe index c9ad2c3..2d6bdd4 100644 Binary files a/projetfinalaccent2.exe and b/projetfinalaccent2.exe differ diff --git a/words.txt b/words.txt index 2f5f5dc..e96e548 100644 --- a/words.txt +++ b/words.txt @@ -99169,4 +99169,5 @@ zygotes étude étude's études -? \ No newline at end of file +? +! \ No newline at end of file -- libgit2 0.21.2