vkandy / simhash-js Goto Github PK
View Code? Open in Web Editor NEWSimhash implementation in Javascript
License: MIT License
Simhash implementation in Javascript
License: MIT License
At first, there is an access privilege problem of method "similarity", since it was declared as var, so it can not be access from outside. I solved this problem, but
Secondly, the calling of "simhash.of(xxx)" will always return 0, so I can't get any meaningful result.
By the way, the Jenkins Hash returns 0 for many inputs, I don't know whether it is correct.
Hi,
Would be awesome to publish simhash-js in npm.
Thanks
TEST 1:
let a = 'the cat sat on the mat'
let b = 'the cat sat on a mat'
let h1 = simhash.hash(a)
let h2 = simhash.hash(b)
console.log(h1, h2, sjs.Comparator.similarity(h1, h2))
// ------------ result
// 687990018 690349194 0.16666666666666666
TEST2:
let a = 'the cat sat on the mat'
let b = 'xxx xxxxxx xx xxx xxx'
let h1 = simhash.hash(a)
let h2 = simhash.hash(b)
console.log(h1, h2, sjs.Comparator.similarity(h1, h2))
// -------------- result
// 687990018 236331081 0.23529411764705882
Hi, what's the license of this code? (Please say MIT License) would like to use this in one of my projects, thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.