DjangoPeng / DjangoPeng/word2vec

Patch for /trunk/word2vec.c

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Type-Patch
Dominant language
C
Stars
3
Forks
5
PR merge metrics
No merged PRs in 30d

Description

```
Patch for bug, which caused discarding the last word of vocab after sorting if
there was no newline character in the input file.

If there is no newline in the input file, vocab[0].cn==0, which is ignored in
sorting, but is not in the for loop, where it decrements the vocab_size and
frees the memory of the last word. However, it still computes the hash for the
last word if its count is greater than min_count. Also the realloc needs to
allocate only vocab_size * sizeof(struct vocab_word).
```

Original issue reported on code.google.com by `FerroMrkva` on 5 Feb 2014 at 11:24

Attachments:
- [word2vec.c.patch](https://storage.googleapis.com/google-code-attachments/word2vec/issue-16/comment-0/word2vec.c.patch)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.