@@ -331,7 +331,7 @@ int get_cooccurrence() {
331331 fid = stdin ;
332332 sprintf (format ,"%%%ds" ,MAX_STRING_LENGTH );
333333 sprintf (filename ,"%s_%04d.bin" ,file_head , fidcounter );
334- foverflow = fopen (filename ,"w " );
334+ foverflow = fopen (filename ,"wb " );
335335 if (verbose > 1 ) fprintf (stderr ,"Processing token: 0" );
336336
337337 /* For each token in input stream, calculate a weighted cooccurrence sum within window_size */
@@ -342,7 +342,7 @@ int get_cooccurrence() {
342342 fclose (foverflow );
343343 fidcounter ++ ;
344344 sprintf (filename ,"%s_%04d.bin" ,file_head ,fidcounter );
345- foverflow = fopen (filename ,"w " );
345+ foverflow = fopen (filename ,"wb " );
346346 ind = 0 ;
347347 }
348348 flag = get_word (str , fid );
@@ -384,7 +384,7 @@ int get_cooccurrence() {
384384
385385 /* Write out full bigram_table, skipping zeros */
386386 if (verbose > 1 ) fprintf (stderr , "Writing cooccurrences to disk" );
387- fid = fopen (filename ,"w " );
387+ fid = fopen (filename ,"wb " );
388388 j = 1e6 ;
389389 for (x = 1 ; x <= vocab_size ; x ++ ) {
390390 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