Commit 76053da1a5fe62cc996723abe5a0134b918758fe
1 parent
89b9e3f8
update des fichiers
Showing
5 changed files
with
40 additions
and
44 deletions
Show diff stats
find.c deleted
... | ... | @@ -1,36 +0,0 @@ |
1 | -#include "find.h" | |
2 | - | |
3 | - | |
4 | -int find_mot(struct node **tab_ptr_tree,wchar_t mot[],int size,int fl) | |
5 | -{ | |
6 | - if(size==1 && tab_ptr_tree[fl]!=NULL) | |
7 | - { | |
8 | - if(tab_ptr_tree[fl]->fin==0)return 1; | |
9 | - else return 0;//vrais | |
10 | - } | |
11 | - if(size==1 && tab_ptr_tree[fl]==NULL)return 1;//faux | |
12 | - | |
13 | - struct node *ptr_node = tab_ptr_tree[fl]; | |
14 | - for(int i=1;i<size;i++) | |
15 | - { | |
16 | - if(ptr_node->nbr_fils==0)return 1; | |
17 | - for(int k=0;k<(ptr_node->nbr_fils);k++) | |
18 | - { | |
19 | - //if(ptr_node->fils[k]->nbr_fils==0)return 1; | |
20 | - if(ptr_node->fils[k]->val==mot[i]) | |
21 | - { | |
22 | - ptr_node=ptr_node->fils[k]; | |
23 | - break; | |
24 | - } | |
25 | - else if(k+1==ptr_node->nbr_fils)return 1; | |
26 | - } | |
27 | - } | |
28 | - | |
29 | - if(ptr_node->fin==0)return 1; | |
30 | - else return 0; | |
31 | -} | |
32 | - | |
33 | -int find() | |
34 | -{ | |
35 | - return 0; | |
36 | -} |
find.h deleted
... | ... | @@ -72,7 +72,7 @@ void splitcarac(struct node **tab_ptr_tree,wchar_t message[]) |
72 | 72 | if(message[0]<'a' || message[0]>'z')return; |
73 | 73 | |
74 | 74 | wchar_t *buffer; |
75 | - wchar_t *token = wcstok(message, L" ,?;.:/!*+\\\"()=", &buffer); | |
75 | + wchar_t *token = wcstok(message, L" ,?;.:/!*+\\\"()=«»", &buffer); | |
76 | 76 | add(tab_ptr_tree,token,size(token),(int)message[0]-97); |
77 | 77 | if(buffer!=NULL)splitcarac(tab_ptr_tree,buffer); |
78 | 78 | } |
... | ... | @@ -116,3 +116,37 @@ void free_dico(struct node **tab_ptr_tree) |
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
119 | + | |
120 | +/*Recherche dans le dictionnaire*/ | |
121 | +int find_mot(struct node **tab_ptr_tree,wchar_t mot[],int size,int fl) | |
122 | +{ | |
123 | + if(size==1 && tab_ptr_tree[fl]!=NULL) | |
124 | + { | |
125 | + if(tab_ptr_tree[fl]->fin==0)return 1; | |
126 | + else return 0;//vrais | |
127 | + } | |
128 | + if(size==1 && tab_ptr_tree[fl]==NULL)return 1;//faux | |
129 | + | |
130 | + struct node *ptr_node = tab_ptr_tree[fl]; | |
131 | + for(int i=1;i<size;i++) | |
132 | + { | |
133 | + if(ptr_node->nbr_fils==0)return 1; | |
134 | + for(int k=0;k<(ptr_node->nbr_fils);k++) | |
135 | + { | |
136 | + if(ptr_node->fils[k]->val==mot[i]) | |
137 | + { | |
138 | + ptr_node=ptr_node->fils[k]; | |
139 | + break; | |
140 | + } | |
141 | + else if(k+1==ptr_node->nbr_fils)return 1; | |
142 | + } | |
143 | + } | |
144 | + | |
145 | + if(ptr_node->fin==0)return 1; | |
146 | + else return 0; | |
147 | +} | |
148 | + | |
149 | +int find() | |
150 | +{ | |
151 | + return 0; | |
152 | +} | ... | ... |