Skip to content

there may be a bug in cooccur.c when the bin file is empty #218

@cicido

Description

@cicido

in file cooccur.c line 177-184
for (i = 0; i < num; i++) {
sprintf(filename,"%s_%04d.bin",file_head,i);
fid[i] = fopen(filename,"rb");
if (fid[i] == NULL) {log_file_loading_error("file", filename); free_fid(fid, num); free(pq); return 1;}
fread(&new, sizeof(CREC), 1, fid[i]);
new.id = i;
insert(pq,new,i+1);
}
when the content in "filename" is empty, the CREC new will computer twice。
let's see the corpus has only the following words:
"training the vectors can be speeded up by increasing the training parallelism to match the number of physical CPU cores available"
there will generate two bin files, and one of files is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions