- Timestamp:
- 2012-02-28T13:59:00+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/indexers/mg/src/text/mg_weights_build.c
r16583 r25147 38 38 #include "words.h" 39 39 40 #define MAXBITS (sizeof( unsignedlong) * 8)40 #define MAXBITS (sizeof(mg_u_long) * 8) 41 41 42 42 /* … … 81 81 static char *file_name = ""; 82 82 static char *text_file_name = ""; 83 static unsignedlong NumPara = 0;84 static unsignedlong StaticNumOfDocs = 0;85 86 unsignedlong get_NumPara (void);87 unsignedlong get_StaticNumOfDocs (void);83 static mg_u_long NumPara = 0; 84 static mg_u_long StaticNumOfDocs = 0; 85 86 mg_u_long get_NumPara (void); 87 mg_u_long get_StaticNumOfDocs (void); 88 88 void GenerateWeights (void); 89 89 void Make_weight_approx (void); … … 141 141 142 142 143 unsignedlong143 mg_u_long 144 144 get_NumPara (void) 145 145 { … … 158 158 159 159 160 unsignedlong160 mg_u_long 161 161 get_StaticNumOfDocs (void) 162 162 /* the static number of documents is the N parameter used to … … 253 253 { 254 254 u_char dummy1, dummy2[MAXSTEMLEN + 1]; 255 unsignedlong fcnt, wcnt, blk, CurrDoc, p, j;255 mg_u_long fcnt, wcnt, blk, CurrDoc, p, j; 256 256 float idf; 257 257 … … 281 281 /* check the inverted file index entry for this word */ 282 282 { 283 unsignedlong loc;283 mg_u_long loc; 284 284 fread ((char *) &loc, sizeof (loc), 1, idx); 285 285 NTOHUL(loc); /* [RPAP - Jan 97: Endian Ordering] */ … … 292 292 for (j = 0; j < p; j++) 293 293 { 294 unsignedlong x, tf;294 mg_u_long x, tf; 295 295 BBLOCK_DECODE (x, blk); 296 296 CurrDoc += x; … … 346 346 { 347 347 int i, pos, max; 348 unsignedlong buf;348 mg_u_long buf; 349 349 double U, L, B; 350 350 FILE *approx, *exact; … … 368 368 369 369 } 370 fseek (exact, sizeof ( u_long), SEEK_SET);370 fseek (exact, sizeof (mg_u_long), SEEK_SET); 371 371 372 372 B = pow (U / L, pow (2.0, -(double) bits)); … … 392 392 for (buf = pos = i = 0; i < NumPara; i++) 393 393 { 394 unsignedlong fx;394 mg_u_long fx; 395 395 float wgt; 396 396 fread ((char *) &wgt, sizeof (wgt), 1, exact); … … 476 476 struct 477 477 { 478 unsignedlong Start;478 mg_u_long Start; 479 479 float Weight; 480 480 } … … 483 483 { 484 484 int count; 485 fread ((char *) &data.Start, sizeof ( unsignedlong), 1, idx);485 fread ((char *) &data.Start, sizeof (mg_u_long), 1, idx); 486 486 if (para && i < cth.num_of_docs) 487 487 { … … 502 502 } 503 503 /* Write out the extra entry for the idx file */ 504 fread ((char *) &data.Start, sizeof ( unsignedlong), 1, idx);504 fread ((char *) &data.Start, sizeof (mg_u_long), 1, idx); 505 505 data.Weight = 0; 506 506 fwrite((char*)&data, sizeof(data), 1, idx_wgt);
Note:
See TracChangeset
for help on using the changeset viewer.