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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| int main(int argc, char *argv[])
{
ChainonMot const *pc;
int i,j,k,l;
int freq=0;
TableHachageMot *DblTableHash1en =CreerDoubleTableHachage();
TableHachageMot *DblTableHash2en =CreerDoubleTableHachage();
TableHachageMot *DblTableHash1fr =CreerDoubleTableHachage();
TableHachageMot *DblTableHash2fr =CreerDoubleTableHachage();
int nbLignes1;
ChainonCoord const *pcCoord;
#ifdef _MSC_VER
{
int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
tmpFlag |= _CRTDBG_CHECK_ALWAYS_DF;
_CrtSetDbgFlag( tmpFlag );
}
#endif
if(TraiterFichier(DblTableHash1en, DblTableHash2en, "en", &nbLignes1)!=EXIT_SUCCESS)
return EXIT_FAILURE;
for(i=0;i<TAILLEHASH;i++)
{
for(j=0 ; j<=TAILLEHASH ; j++)
{
for(pc=GetPremierC(&DblTableHash1en[i][j]) ; pc!=NULL ; pc=GetNextC(pc))
{
printf("%s \n",GetMot(pc));
for(pcCoord = coord_GetPremierC(GetPtrCoordC(pc)) ; pcCoord!=NULL ; pcCoord=coord_GetNextC(pcCoord))
{
printf("%i %i \n",GetLigne(pcCoord),j);
}
}
}
}
if(TraiterFichier(DblTableHash1fr, DblTableHash2fr, "fr", &nbLignes1)!=EXIT_SUCCESS)
return EXIT_FAILURE;
printf("génération des triggers inter-langues \n");
printf("ouverture du fichier... \n");
FILE *pfOut = fopen("triggers.txt", "w");
for(i=0 ; i<=TAILLEHASH ; i++)
{
for(j=0 ; j<=TAILLEHASH ; j++)
{
//ChainonMot const *pc;
for(pc=GetPremierC(&DblTableHash1fr[i][j]) ; pc!=NULL ; pc=GetNextC(pc))
{
for(k=0 ; k<TAILLEHASH ; k++)
{
for(l=0 ; l<TAILLEHASH ; l++)
{
ChainonMot const *pc2;
for(pc2=GetPremierC(&DblTableHash1en[k][l]) ; pc2!=NULL ; pc2=GetNextC(pc2))
{
TraiterCoupleMots(pc, pc2,pfOut,nbLignes1);
}
}
}
}
}
}
fclose(pfOut);
pfOut = fopen("triggers.txt", "a");
for(i=0 ; i<=TAILLEHASH ; i++)
{
for(j=0 ; j<=TAILLEHASH ; j++)
{
for(pc=GetPremierC(&DblTableHash2fr[i][j]) ; pc!=NULL ; pc=GetNextC(pc))
{
for(k=0 ; k<TAILLEHASH ; k++)
{
for(l=0 ; l<TAILLEHASH ; l++)
{
ChainonMot const *pc2;
for(pc2=GetPremierC(&DblTableHash1en[k][l]) ; pc2!=NULL ; pc2=GetNextC(pc2))
{
TraiterCoupleMots1(pc, pc2,pfOut,nbLignes1,&DblTableHash1en,&DblTableHash1fr);
}
}
}
}
}
}
fclose(pfOut);
return EXIT_SUCCESS;
} |
Partager