1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
int main()
{
FILE *F;
char mot[100];
int i;
unsigned int cle,pt;
int nl, pos;
nl=pos=1;
char c;
int seuil;
Liste **L;
Liste **TableHash;
TableHash = (Liste **) malloc (TAILLEHASH * sizeof(Liste *));
for(i=0;i<TAILLEHASH;++i)
TableHash[i] = NULL;
pt=hash_cle(".");
//printf("%d",pt);
printf("debut du programme \n----------------------------------\n");
F=fopen("C:\\Documents and Settings\\siril\\Bureau\\projet\\text.txt","r");
while(fscanf(F,"%s",mot)==1){
cle = hash_cle(mot);
if ((cle!=pt ) && (! ChercherMotDansTableHash(TableHash,mot)))
TableHash[cle] = InsertionEnTete(TableHash[cle],mot);
}
fclose(F );
F=fopen("C:\\Documents and Settings\\siril\\Bureau\\projet\\text.txt","r");
PosLigne(F,TableHash);
//filtrage
printf("\nla liste filtre :\n----------------------------------\n");
FiltreListe(TableHash,2);
AfficherTableHash(TableHash);
//géneration des 2seq
Liste *seq=NULL;
Generer2seq(TableHash, 2, &seq);
printf("\nla liste des 2seq :\n----------------------------------\n");
AfficherListe(seq);
scanf("%c",c);
return 0;
}
void AfficherListe(Liste *L){
Liste *p;
for(p=L;p!=NULL;p=p->suivant){
AfficheMot(p->mot);
AfficherCoordonnees(p->c);
}
}
void AfficheMot(char *mot){
printf("%s ",mot);
} |
Partager