Commit 3980f042f312ddd94568d4f4833edf879554e2c8
1 parent
c2f3660b
affichage des mots non reconnus
Showing
1 changed file
with
26 additions
and
7 deletions
Show diff stats
... | ... | @@ -181,21 +181,32 @@ int find_mot(dico Dico, wchar_t mot[]) |
181 | 181 | break; |
182 | 182 | } |
183 | 183 | } |
184 | - if (fl == -1)return 1; | |
184 | + if (fl == -1){ | |
185 | + wprintf(mot); | |
186 | + wprintf(L"\n"); | |
187 | + return 1; | |
188 | + } | |
185 | 189 | } |
186 | 190 | |
187 | 191 | int taille = size(mot); |
188 | 192 | if (taille == 1 && Dico.tab_ptr_tree[fl] != NULL) |
189 | 193 | { |
190 | - if (Dico.tab_ptr_tree[fl]->fin == 0)return 1; | |
191 | - else return 0; //vrais | |
194 | + if (Dico.tab_ptr_tree[fl]->fin == 0){ | |
195 | + wprintf(mot); | |
196 | + wprintf(L"\n"); | |
197 | + return 1; | |
198 | + }else return 0; //vrais | |
192 | 199 | } |
193 | 200 | if (Dico.tab_ptr_tree[fl] == NULL)return 1; //faux |
194 | 201 | |
195 | 202 | struct node *ptr_node = Dico.tab_ptr_tree[fl]; |
196 | 203 | for (int i = 1; i < taille; i++) |
197 | 204 | { |
198 | - if (ptr_node->nbr_fils == 0)return 1; | |
205 | + if (ptr_node->nbr_fils == 0){ | |
206 | + wprintf(mot); | |
207 | + wprintf(L"\n"); | |
208 | + return 1; | |
209 | + } | |
199 | 210 | for (int k = 0; k < (ptr_node->nbr_fils); k++) |
200 | 211 | { |
201 | 212 | if (ptr_node->fils[k]->val == mot[i]) |
... | ... | @@ -203,13 +214,19 @@ int find_mot(dico Dico, wchar_t mot[]) |
203 | 214 | ptr_node = ptr_node->fils[k]; |
204 | 215 | break; |
205 | 216 | } |
206 | - else if (k + 1 == ptr_node->nbr_fils) | |
217 | + else if (k + 1 == ptr_node->nbr_fils){ | |
218 | + wprintf(mot); | |
219 | + wprintf(L"\n"); | |
207 | 220 | return 1; |
221 | + } | |
208 | 222 | } |
209 | 223 | } |
210 | 224 | |
211 | - if (ptr_node->fin == 0)return 1; | |
212 | - else return 0; | |
225 | + if (ptr_node->fin == 0){ | |
226 | + wprintf(mot); | |
227 | + wprintf(L"\n"); | |
228 | + return 1; | |
229 | + }else return 0; | |
213 | 230 | } |
214 | 231 | |
215 | 232 | //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[]) |
218 | 235 | wchar_t val[3000]; |
219 | 236 | int cpt_erreur = 0; |
220 | 237 | |
238 | + wprintf(L"Mots non reconnus :\n"); | |
239 | + | |
221 | 240 | while (fwscanf(fp, L"%ls", val) == 1) |
222 | 241 | { |
223 | 242 | toLowerCase(val);//Fichier mit en minuscule | ... | ... |