Skip to content

Conversation

@Simsso
Copy link

@Simsso Simsso commented Jun 5, 2019

The if statement if (word == -1) continue; will never evaluate to true because when filling the sen array, words with id -1 are already being discarded by this check a few lines above.

I suggest to remove the if-statement because it is misleading and if it every evaluated to true, it would do so in the next iteration again (because sentence_position would not change) and the program would be in an infinite loop.

The if statement `if (word == -1) continue;` will never evaluate to `true` because when filling the `sen` array, words with id `-1` are already being discarded by [this](https://github.com/dav/word2vec/blob/0f29b188b17145d0c1d0953ba0bc80a2208dd8a0/src/word2vec.c#L413) check a few lines above.

I suggest to remove the if-statement because it is misleading and if it every evaluated to `true`, it would do so in the next iteration again (because `sentence_position` would not change) and the program would be in an infinite loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant