@@ -332,7 +332,7 @@ int get_cooccurrence() {
332332 fid = stdin ;
333333 sprintf (format ,"%%%ds" ,MAX_STRING_LENGTH );
334334 sprintf (filename ,"%s_%04d.bin" ,file_head , fidcounter );
335- foverflow = fopen (filename ,"w " );
335+ foverflow = fopen (filename ,"wb " );
336336 if (verbose > 1 ) fprintf (stderr ,"Processing token: 0" );
337337
338338 /* For each token in input stream, calculate a weighted cooccurrence sum within window_size */
@@ -343,7 +343,7 @@ int get_cooccurrence() {
343343 fclose (foverflow );
344344 fidcounter ++ ;
345345 sprintf (filename ,"%s_%04d.bin" ,file_head ,fidcounter );
346- foverflow = fopen (filename ,"w " );
346+ foverflow = fopen (filename ,"wb " );
347347 ind = 0 ;
348348 }
349349 flag = get_word (str , fid );
@@ -385,7 +385,7 @@ int get_cooccurrence() {
385385
386386 /* Write out full bigram_table, skipping zeros */
387387 if (verbose > 1 ) fprintf (stderr , "Writing cooccurrences to disk" );
388- fid = fopen (filename ,"w " );
388+ fid = fopen (filename ,"wb " );
389389 j = 1e6 ;
390390 for (x = 1 ; x <= vocab_size ; x ++ ) {
391391 if ( (long long ) (0.75 * log (vocab_size / x )) < j ) {j = (long long ) (0.75 * log (vocab_size / x )); if (verbose > 1 ) fprintf (stderr ,"." );} // log's to make it look (sort of) pretty
0 commit comments