Skip to content

Commit

Permalink
Merge pull request #1 from duhaime/hashband-strings
Browse files Browse the repository at this point in the history
store hashband keys as strings
  • Loading branch information
duhaime authored Mar 14, 2018
2 parents d88af09 + ce66f89 commit 1a257cd
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion minhash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minhash",
"version": "0.0.7",
"version": "0.0.8",
"description": "Find similar documents quickly",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/lsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var LshIndex = function(args) {
var start = i * this.bandSize;
var end = start + this.bandSize;
var band = minhash.hashvalues.slice(start, end);
minhash.hashbands.push(band);
minhash.hashbands.push(band.join('.'));
};
return minhash.hashbands;
};
Expand Down
1 change: 0 additions & 1 deletion src/minhash.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ var Minhash = function(config) {
var config = config || {};
this.numPerm = config.numPerm || 128;
this.seed = config.seed || 1;
this.hashFunctions = [];
this.hashvalues = [];
this.permA = [];
this.permB = [];
Expand Down
2 changes: 1 addition & 1 deletion tests/test-lsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('LshIndex', function() {
var m1 = new Minhash();
var index = new LshIndex({bandSize: 3});
index.insert('m1', m1);
(m1.hashbands[0].length === 3).should.equal(true);
(m1.hashbands[0].split('.').length === 3).should.equal(true);
})
});
})

0 comments on commit 1a257cd

Please sign in to comment.