Planeshifter / node-word2vec

Node.js interface to the Google word2vec tool.
Apache License 2.0
348 stars 55 forks source link

.mostSimilar() returns array of undefined words for an out-of-dictionary word #10

Closed josephrocca closed 8 years ago

josephrocca commented 8 years ago

As the title says, .mostSimilar() returns array of objects with word = undefined and dist = -1 for an out-of-dictionary word. The array is as long as the number of entries requested in the second argument of mostSimilar. I would expect it to return an empty array or null if the word is not found in the dictionary.

Cheers

Planeshifter commented 8 years ago

Thanks for this suggestion! I changed the functionality of the function such that it now returns null if all phrase words are out-of-dictionary.

josephrocca commented 8 years ago

Thanks!