Blame view

dico.c 578 Bytes
0bc3d1ad   bjeanlou   dico created
1
2
3
4
5
6
  #include "dico.h"
  
  void make_empty_dico(dico d){
    for(int i=0;i<NB1CHAR;i++)
      d[i]=NULL;
  }
a0fe64d2   bjeanlou   Update dico
7
  void delete_dico(dico d){
0bc3d1ad   bjeanlou   dico created
8
9
10
11
    for(int i=0;i<NB1CHAR;i++)
      delete_tree(d[i]);
  }
  
a0fe64d2   bjeanlou   Update dico
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  byte end_kind(const string s){
    byte endKind=0;
    int i=1;
    if(!isalpha(s[0]))
      return 0;
    if(islower(s[0])){
      endKind=1;
      while(islower(s[i]));
    }
    else {//if isupper(s[0])
      
    }
    endKind*=( (s[i]=='\0') + 2* (s[i]=='\''&&s[i+1]=='s'&&s[i+2]=='\0') );
    return endKind;
  }
  
  bool is_word(const byte endKind){
    return end_Kind!=0;
  }
0bc3d1ad   bjeanlou   dico created
31
  
a0fe64d2   bjeanlou   Update dico
32
33
  bool addto_dico(dico d,string s){
    if(is_word()
0bc3d1ad   bjeanlou   dico created
34
  }