Commit f325dd233f191888fd0fbe94b8e1155d5aabc67a

Authored by rsimonin
1 parent 2e977567

modif init dico

Showing 1 changed file with 2 additions and 10 deletions   Show diff stats
@@ -31,11 +31,6 @@ bool fin_de_mot(struct arbre *arbre) @@ -31,11 +31,6 @@ bool fin_de_mot(struct arbre *arbre)
31 { 31 {
32 return arbre->finmot; 32 return arbre->finmot;
33 } 33 }
34 -void initialise_dico(struct arbre * pt_arbre,char val){  
35 -  
36 -  
37 -  
38 -}  
39 34
40 void cons_dico(struct dico **pt_dico,char val){ 35 void cons_dico(struct dico **pt_dico,char val){
41 Dico *mondico=malloc(sizeof(struct dico)); 36 Dico *mondico=malloc(sizeof(struct dico));
@@ -69,13 +64,13 @@ void ini_dico(struct dico * pt_dico){ @@ -69,13 +64,13 @@ void ini_dico(struct dico * pt_dico){
69 void ajout_mot(struct dico *pt_dico,char mot[]){ 64 void ajout_mot(struct dico *pt_dico,char mot[]){
70 int i=0; 65 int i=0;
71 while(mot[i]!='\0'){ 66 while(mot[i]!='\0'){
72 - if (pt_dico->alpha[val[i]-'a']==NULL){ 67 + if (pt_dico->alpha[mot[i]-'a']==NULL){
73 cons_arbre(&(pt_dico->alpha[mot[i]-'a']),mot[i]); 68 cons_arbre(&(pt_dico->alpha[mot[i]-'a']),mot[i]);
74 69
75 } 70 }
76 i++; 71 i++;
77 } 72 }
78 - pt_dico->alpha[fscval[i]-'a']->finmot=true; 73 + pt_dico->alpha[mot[i]-'a']->finmot=true;
79 74
80 } 75 }
81 76
@@ -83,11 +78,8 @@ void charger_arbre(FILE *fp, struct dico **pt_dico) @@ -83,11 +78,8 @@ void charger_arbre(FILE *fp, struct dico **pt_dico)
83 { char mot[20]; 78 { char mot[20];
84 while (fscanf(fp, "%s", mot)!=EOF){ 79 while (fscanf(fp, "%s", mot)!=EOF){
85 ajout_mot(*pt_dico,mot); 80 ajout_mot(*pt_dico,mot);
86 -  
87 - // -------------------------------------------------------------  
88 } 81 }
89 return ; 82 return ;
90 - //Tip: use while(fscanf(..) ...)  
91 } 83 }
92 84
93 85