Skip to content

Commit

Permalink
null check added
Browse files Browse the repository at this point in the history
  • Loading branch information
nikit-srivastava committed Oct 18, 2018
1 parent c381f05 commit c5dbeb2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ private String getClosestEntry(float[] vector, String subKey) {
double cosSimVal = Word2VecMath.cosineSimilarityNormalizedVecs(curCompVec, vector);
int indx = getBucketIndex(cosSimVal);
BitSet curBs = new BitSet(word2vec.size());
curBs.or(csBucketContainer[i][indx]);
BitSet tempBs = csBucketContainer[i][indx];
if(tempBs!=null) {
curBs.or(tempBs);
}
int temIndx = indx + 1;
if (temIndx < csBucketContainer[i].length && csBucketContainer[i][temIndx] != null) {
curBs.or(csBucketContainer[i][temIndx]);
Expand Down

0 comments on commit c5dbeb2

Please sign in to comment.